function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Paula Jarvis 4Paula Jarvis 4 

Why does Trigger result in an ID and not a value?

I have this trigger that basically works however the results provided in the field are an ID and not an actual pick list value. How can I amend this to get the same lookup value to populate the pick list field when the Lookup field is edited?

trigger EMRSystem on Lead (before insert, before update) {
    { 
        for (Lead a : Trigger.new) 
        { 
            a.EMR_System_1__c = a.EMR_System_Confirmed__c;
        }
    }
}
Laraib_JafriLaraib_Jafri

You don't need to use a trigger for this, also i am not sure if i understand what you're asking. 

Are you saying that after the trigger runs a.EMR_System_Confirmed__c shows a ID in string form? 

Is a.EMR_System_Confirmed__c setup as a Text field? If so, you will need to change it to a Lookup field.

Paula Jarvis 4Paula Jarvis 4
EMR System Confirmed is a Lookup FIeld to a cusotm object. EMR System is a picklist field. I am trying to populate the EMR System pick list field from the EMR System confirmed Lookup Field. My trigger returns the ID instead of the product name.