function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tedevangtedevang 

Custom Button javascript retURL not working

I'm using the following javascript to invoke a new task for the primary contact (a custom lookup field on the Account object). The task is created just fine with the primary contact in the Contact field, but upon saving, it returns to the home page instead of the account page from which it was called. Any suggestions that would redirect this to the account page?

 

navigateToUrl('/00T/e?who_id={!Account.Primary_Contact_Lookup__c}&retURL=%2F{!Account.Id}');

 

Thanks.

Best Answer chosen by Admin (Salesforce Developers) 
sforce2009sforce2009

This type of URL worked for me perfectly

'00T/e?customfield={!custom_Field__c}&retURL={!Idfield}';