How To Assign New Owner In Sales Lead Using Groovy Script
I am trying to develop a way to reassign a lead back to its previous owner when the current assigned owner rejects the assignment. However, on the part of setting the owner id, it was not straightforward as I thought. I keep seeing the following issue when I just set the OwnerId to the Party Id of the previous owner. I'm thinking it's not the way to go and there must be a whole line of script that adds the user to the Sales Team etc. How do I go about this?