• Viswa
  • NEWBIE
  • 45 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 8
    Replies

Hi,

How can i reduce size/change postion of datepicker of lightning input of type date.As i am unable to select the day of last week of a month.

User-added image

  • July 01, 2021
  • Like
  • 0
How can we display the wrapper class values in the lighting data table markup with custom lables?
  • June 09, 2021
  • Like
  • 0
How can we get FIle/Attachment With the help of recordid
  • May 31, 2021
  • Like
  • 0

Hi,

Can Any one suggest  me the reason for error. Here is my below code.

Apex Class:

public with sharing class MaintenanceRequestHelper {
    
    public static void updateWorkOrders(List<Case> caseList) {
        List<case> newCases = new List<Case>();
        Map<String,Integer> result=getDueDate(caseList);
        for(Case c : caseList){
            if(c.status=='closed')
                if(c.type=='Repair' || c.type=='Routine Maintenance'){
                    Case newCase = new Case();
                    newCase.Status='New';
                    newCase.Origin='web';
                    newCase.Type='Routine Maintenance';
                    newCase.Subject='Routine Maintenance of Vehicle';
                    newCase.Vehicle__c=c.Vehicle__c;
                    newCase.ProductId=c.ProductId;
                    newCase.Date_Reported__c=Date.today();
                    if(result.get(c.Id)!=null)
                     newCase.Date_Due__c=Date.today()+result.get(c.Id);
                    else
                        newCase.Date_Due__c=Date.today();
                    newCases.add(newCase);
                }
        }        
        insert newCases;   
    }
    
    public static  Map<String,Integer> getDueDate(List<case> CaseIDs){       
       Map<String,Integer> result = new Map<String,Integer>();
        Map<Id, case> caseKeys = new Map<Id, case> (CaseIDs);        
       List<AggregateResult> wpc=[select Maintenance_Request__r.ID cID,min(Equipment__r.Maintenance_Cycle__c)cycle
                      from Equipment_Maintenance_Item__c where  Maintenance_Request__r.ID in :caseKeys.keySet() group by             Maintenance_Request__r.ID ];
        for(AggregateResult res :wpc){
            Integer addDays=0;
            if(res.get('cycle')!=null)
                addDays+=Integer.valueOf(res.get('cycle'));
            result.put((String)res.get('cID'),addDays);
        }
        return result;
}

}

Apex Trigger;
trigger MaintenanceRequest on Case (after update) {
    // ToDo: Call MaintenanceRequestHelper.updateWorkOrders
                 MaintenanceRequestHelper.updateWorkOrders(Trigger.New);
}
 

User-added image

  • April 05, 2021
  • Like
  • 0

Hi,

I would like to display the converted currency in the list view of the object.
For example, if an opportunity is created with currency as Japanese it currency converted value is displayed in braces. Now I would like to display the converted value in the list view. From the below SC i would to display usd value in the List view.

 

Any suggestions will be appreciated. User-added image

  • March 19, 2021
  • Like
  • 0
Only the owner can change the ownership of the record
  • January 22, 2021
  • Like
  • 0
Whenever users except the system admin refresh the page It throws an error as shown in the attachment.User-added image
  • January 11, 2021
  • Like
  • 0
I have a custom button content of the visual force page on the Account detail page.  I want to make the button enable on the salesforce mobile1 app and disable on other UI themes. Any ideas  will be appreciated

thanks & regards
Viswanath
  • October 15, 2020
  • Like
  • 0
How to mail the content document as an attachment?? any suggestions
  • October 10, 2020
  • Like
  • 0
Even though the lightning page does not contain a managed package component lightningbuddy component when the  user(Assigned that particular lightning page to him) clicks on the object gets the below errorUser-added image
  • September 30, 2020
  • Like
  • 0
I  would like to create a flow, which shows different fields based on the selected picklist values on the standard account page layout.
 
  • September 03, 2020
  • Like
  • 0
How to fetch Parent Account Contacts in Child Account Contact's "Report To" field using Lookup filters?
Also I'm trying in the following way, but I'm getting Child Accounts Contacts in Parent Account Contacts "Reports To" field and not able to get Parent Account Contacts in Child Account Contact's "Reports To". 
Any help for this will be much appreciated.
*Parent Account --> Renamed to Parent OrganisationUser-added image
Thank you
  • August 26, 2020
  • Like
  • 0
(Master detail relation b/w Account and  Hobbies object)
In Account, a muli picklist called 'Hobbies'. Whenever I selected a few values from the picklist and saved the Account record.....I need to create records in Hobbie's obj with those picklist values.
  • August 24, 2020
  • Like
  • 0

Hi,

Can Any one suggest  me the reason for error. Here is my below code.

Apex Class:

public with sharing class MaintenanceRequestHelper {
    
    public static void updateWorkOrders(List<Case> caseList) {
        List<case> newCases = new List<Case>();
        Map<String,Integer> result=getDueDate(caseList);
        for(Case c : caseList){
            if(c.status=='closed')
                if(c.type=='Repair' || c.type=='Routine Maintenance'){
                    Case newCase = new Case();
                    newCase.Status='New';
                    newCase.Origin='web';
                    newCase.Type='Routine Maintenance';
                    newCase.Subject='Routine Maintenance of Vehicle';
                    newCase.Vehicle__c=c.Vehicle__c;
                    newCase.ProductId=c.ProductId;
                    newCase.Date_Reported__c=Date.today();
                    if(result.get(c.Id)!=null)
                     newCase.Date_Due__c=Date.today()+result.get(c.Id);
                    else
                        newCase.Date_Due__c=Date.today();
                    newCases.add(newCase);
                }
        }        
        insert newCases;   
    }
    
    public static  Map<String,Integer> getDueDate(List<case> CaseIDs){       
       Map<String,Integer> result = new Map<String,Integer>();
        Map<Id, case> caseKeys = new Map<Id, case> (CaseIDs);        
       List<AggregateResult> wpc=[select Maintenance_Request__r.ID cID,min(Equipment__r.Maintenance_Cycle__c)cycle
                      from Equipment_Maintenance_Item__c where  Maintenance_Request__r.ID in :caseKeys.keySet() group by             Maintenance_Request__r.ID ];
        for(AggregateResult res :wpc){
            Integer addDays=0;
            if(res.get('cycle')!=null)
                addDays+=Integer.valueOf(res.get('cycle'));
            result.put((String)res.get('cID'),addDays);
        }
        return result;
}

}

Apex Trigger;
trigger MaintenanceRequest on Case (after update) {
    // ToDo: Call MaintenanceRequestHelper.updateWorkOrders
                 MaintenanceRequestHelper.updateWorkOrders(Trigger.New);
}
 

User-added image

  • April 05, 2021
  • Like
  • 0
Only the owner can change the ownership of the record
  • January 22, 2021
  • Like
  • 0
Whenever users except the system admin refresh the page It throws an error as shown in the attachment.User-added image
  • January 11, 2021
  • Like
  • 0
I have a custom button content of the visual force page on the Account detail page.  I want to make the button enable on the salesforce mobile1 app and disable on other UI themes. Any ideas  will be appreciated

thanks & regards
Viswanath
  • October 15, 2020
  • Like
  • 0
How to mail the content document as an attachment?? any suggestions
  • October 10, 2020
  • Like
  • 0
Even though the lightning page does not contain a managed package component lightningbuddy component when the  user(Assigned that particular lightning page to him) clicks on the object gets the below errorUser-added image
  • September 30, 2020
  • Like
  • 0