You need to sign in to do that
Don't have an account?
Nikhil Vodapally 5
Trigger creating "null" alongside other values
Hi Peeps,
I'm new to writing Triggers but managed to make my Trigger work the way its designed to work. However, it is populating NULL alongside default values.
The Trigger updates a Multi-select picklist with default values when a checkbox is checked.
Can someone help me remove the NULL value please?
Regards,
Nikhil
I'm new to writing Triggers but managed to make my Trigger work the way its designed to work. However, it is populating NULL alongside default values.
The Trigger updates a Multi-select picklist with default values when a checkbox is checked.
trigger AutoPopulateProDiscussed on Meeting_Call_Report__c (before insert, before update) { if(trigger.isInsert || trigger.isUpdate){ for (Meeting_Call_Report__c mcr : Trigger.new){ if(mcr.Benchmark_Reform__c == True && mcr.ProDiscussedTriggerHelper__c == False){ mcr.Products_Discussed__c += ';€STR;SOFR (Secured overnight financing rate)'; mcr.ProDiscussedTriggerHelper__c = True; } } } }
Can someone help me remove the NULL value please?
Regards,
Nikhil
Replace this line mcr.Products_Discussed__c += ';€STR;SOFR (Secured overnight financing rate)'; as below
All Answers
Change this line mcr.Products_Discussed__c += ';€STR;SOFR (Secured overnight financing rate)'; as below
Thanks for the answer but I need the multiselect picklist field to default to the values in the Trigger in addition to the values the User selects whilst creating/updating the record. Can you help?
Add the Null check before adding the values when there are exisiting values in the field.
and in else add the line which I posted earlier.
Apologies, I dont understand. :-(
Replace this line mcr.Products_Discussed__c += ';€STR;SOFR (Secured overnight financing rate)'; as below