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
ankur khattriankur khattri 

in trigger i want 2 assign value in ank_kha__c= 1030 Garhi and it is a lookup field of Account.Object name is Ankur__c.

ajay rawat 14ajay rawat 14
Hi Ankur
            First you need to get record id by using soql
ID accountId = [SELECT ID FROM WHERE Ankur__c='1030 Garhi' limit 1].id;
then assign this id to lookup field
objectInstance.ank_kha__c = accountId;

Thanks and Regards,
Ajay Rawat