You need to sign in to do that
Don't have an account?
Help with creating a trigger
Hi Developers! A Salesforce admin here humbly requesting any assistance! I have request to change the workflow that I have on the leads object, that states, when a lead is placed back in Status: "Nurture" status (not on creation) or Reject, it changes the owner to a designated queue. They would now like it to return to the person that once had ownership of it automatically. Thinking I can create a trigger on after Update event which will check the "Lead Status" and if it is equal to "Nurture" or "Reject" then it can assign the lead to the previous owner by querying on "Lead History" object to get the Previous Owner. I have watched numerous youtube videos on creating triggers and I am afraid I am no closer to coding this, then I was before I started my deep youtube dive. Any links to resources, advice you can offer or actual code would be greatly helpful!
Try the below code:
Lead Trigger:
Apex Class:
This code changes the owner to previous owner when the sttaus is changed to 'Nurture' or 'Reject'
Thanks
Hope this will Help.
All Answers
Try the below code:
Lead Trigger:
Apex Class:
This code changes the owner to previous owner when the sttaus is changed to 'Nurture' or 'Reject'
Thanks
Hope this will Help.
You are soooo awesome! Thank you so much for responding. I will try this and circle back as soon as I can.
Thanks again!
Adria