Timeline for Trigger.OldMap returns new Value
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 30, 2020 at 21:18 | vote | accept | GroundToCloud | ||
Jan 30, 2020 at 21:18 | comment | added | GroundToCloud | Thank you ! that helps ! | |
Jan 30, 2020 at 19:46 | comment | added | sfdcfox♦ | @user4947 I'd set the trigger on the Account, then, as that's the only time you'd see the old contact owners. | |
Jan 30, 2020 at 19:25 | comment | added | GroundToCloud | Thank you. I am sorry, but please can you answer one more question. I said we run batch job to change ownership. ActualIy we change Account ownership via Jitterbit. we have a scheduled job to 'Upsert' Accounts. Many updates happen to the Accounts, some Accounts gets ownership update. That's when the Account trigger kicks in to change ownership on Contact. How should i create a task in this case. ? | |
Jan 30, 2020 at 18:59 | comment | added | sfdcfox♦ | @user4947 You'd have to instead assign the task as part of the batch process. The old owner will have already changed by the time the trigger fires, as you've observed. | |
Jan 30, 2020 at 17:21 | comment | added | GroundToCloud | I see! 'Because changing the Account Owner in the UI causes the Contact Owner to change automatically outside of any trigger context.By the time your trigger runs, the owner is indeed already changed.' Thank you,now this makes sense. Does that mean i will not see old Owner? Our Accounts and related contacts are owned by Sales reps. when these are first created,they are owned by 'Guest' we run a batch job to change ownership on Accounts. As a result ownership of Contacts are changed. When this happens i want to create a task for new owner. That's why i am comparing old and new owner value. | |
Jan 30, 2020 at 14:35 | comment | added | gNerb | We had to write a VF page to override the built in owner change functionality for this exact reason. | |
Jan 30, 2020 at 6:17 | history | answered | sfdcfox♦ | CC BY-SA 4.0 |