You need to sign in to do that
Don't have an account?
Biju Narayanan
Capture Account OwnerId updates in a Trigger
Hi
I have a requirement to update some fields of an account based ont he Account Owner Ids. The process should be
1. Write Trigger in the Account Update
2. Check if the Owner is updated
3. Check if a specific Id is common for both Old/New Owners (Select PGroupId, Id from user where id in (OldOwnerId,NewOwnerId)
4. If group id is same for both owners update specific fields in the account.
I have started coding in the Trigger. Since these changes are happening from the ETL process, I am not sure how to bulkify my code. Should I get all the Account Ids before starting the Trigger & Compare in the below trigger ? Any suggestions
for (Account acc: Trigger.new) {
}
Thanks
Biju
I have a requirement to update some fields of an account based ont he Account Owner Ids. The process should be
1. Write Trigger in the Account Update
2. Check if the Owner is updated
3. Check if a specific Id is common for both Old/New Owners (Select PGroupId, Id from user where id in (OldOwnerId,NewOwnerId)
4. If group id is same for both owners update specific fields in the account.
I have started coding in the Trigger. Since these changes are happening from the ETL process, I am not sure how to bulkify my code. Should I get all the Account Ids before starting the Trigger & Compare in the below trigger ? Any suggestions
for (Account acc: Trigger.new) {
}
Thanks
Biju
Something like this is what you will need:
Hope this helps.
Veenesh