You need to sign in to do that
Don't have an account?
Nick.E.Delis
Button for Changing a Lead Automatically to the new Lead owner when Pressed
Does anyone have experience with the code for a button to automatically change the lead owner to that person? I think it is pretty simple... but I don't want them to go through any additional steps just press the button... Thanks for the help!
Hi Nick, you can try this on button click, ll work -
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/19.0/apex.js")}
var shp= new sforce.SObject("Lead");
shp.Id = "{!Lead.Id}";
shp.OwnerId = "{!$User.Id}";
sforce.connection.update([shp]);
window.location.reload();