• CherishX
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi;
I am hoping to get some help on this trigger. I am new to Apex programming. I have a custom object called Dues Calculator. For which I have a picklist depency, when the user selects one option "Unit Type" two additional picklist fields that need to be filled out are pre-populated with the correct options. Since I need to use those fields in formula. I created addtional fields that end in "selected". The purpose of my trigger is to automatically populate the "selected" fields with the options from the picklist depencies.
This is my trigger:
trigger NumberofUnitsPerTypeSelected on Dues_Calculator__c (before insert) {
    for(Dues_Calculator__c dues : Trigger.New){
        
       // Converting and Assigning the Picklist Value to the Selected Field to be used in a formula
        Decimal numberUnitTypeSelected   = Dues.Number_of_Units_Per_Type_Selected__c;
        String  numberUnitType           = Dues.Number__c;
        numberUnitType                     = numberUnitTypeSelected.format(); 
            
        // Converting and Assigning the Picklist Value to the Selected Field to be used in a formula
        Decimal percentageSelected       = Dues.Percentage_of_Ownership_Type_Selected__c;
        String  percentageOwnershipShare = Dues.Percentage_of_Ownership_Share__c;
        percentageOwnershipShare         = percentageSelected.format();
        
        insert dues;
        }
}

I get a Null Pointer Exception error, I tried to add the option to create a list. I am stuck here.

Any help is greatly appreciated;
Peter
When users log in inside the Salesforce mobile application, they use an Okta integration we have set up but, once they try to open a link to an external page which requires the same SSO login (it is a SAP Fiori application integrated with Okta), the page requires again the SSO info to log the user in.
Is there a way to avoid the second login by passing the SSO information from the Salesforce application to the external link?