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
sammy9099sammy9099 

Triiger to update look up field

Hey All , 

 

I am stuck with this situation.I am lead objects in which I have two fields supplier_ID_c and Prefferd_supplier_c. The latter field has look up relation with accounts.So I first need to convert supplier_ID__c field to text format and then populates that text into Preffered_supplier__c field. I have to write trigger for this . I am fairly new to this development. Can anyone help me in writing the triiger ? Any little help will be highly appreciated

Vinit_KumarVinit_Kumar

If I understood correctly supplier_ID_c field is lookup to Account from Lead and you want to populate  Prefferd_supplier_c based on supplier_ID_c.

 

But,my question is with what value you want to populate Prefferd_supplier_c,it is still not clear.

sammy9099sammy9099

Ok .....May Be I am not good in explaining. 

Supplier_id is integer ID's which are equivalent to each record ID of Account. But It doesn't have lookup Relation with account . Preffered Supplier__c has a look up relation with accounts. So we want to populate these supplier id's to preffered supplier__c field after converting this ID's to text format eg: relevant to account name. This will basically makes the  navigation from from lead to supplier account easy .

 

Hope this helps