You need to sign in to do that
Don't have an account?
Sri 7
how to update lookup field based on text field in the same object by using triggers. please help me and send me the code
Scenario 1: The ‘C Name Lookup’, field has the ability to reflect itself if it is at the top of the Hierarchy.
Given there's an Salesforce account with a 'CI company ID'
and 'CI company id' is equal to the 'CaI Ultimate parent Company ID'
When 'CaI Ultimate parent Company ID' is created or modified and 'Override C Name' is not checked
Then the ‘C Name Lookup’ field should be the 'Account' itself.
Given there's an Salesforce account with a 'CI company ID'
and 'CI company id' is equal to the 'CaI Ultimate parent Company ID'
When 'CaI Ultimate parent Company ID' is created or modified and 'Override C Name' is not checked
Then the ‘C Name Lookup’ field should be the 'Account' itself.
Try this code---
trigger TriggerOnAccount on Account (after insert , after update) {
for(Account ac:Trigger.New){
if(ac.CName__c != null){
ac.CI_company_ID=ac.CName__c;
}
}
}
Thanks
Raza