I'm pretty good with URL hacks to set field values in a record, save=1, saveURL/retURL, etc... But I'm getting stuck on something I've never tried before and I don't even know if it is possible. Is it possible to add parameters into the saveURL string?

e.g. /id/e?field1=blah&save=1&saveURL=aDifferent.Id/e?field2=blah&field3=yada

So in other words, what I'm interested in doing is, Update a field on one record with an auto-save, then return to a related ID of a different record on the edit page (all good up to this point). However, I can only seem to pass a single field update after the ? and anything after the ?field2=blah gets dropped and the edit screen won't show the &field3=yada update.

Ultimately, I'd also like to add in an &save=1 on the saveURL string also, so one button can modify and save one record, then modify and save another record. I'm trying to accomplish this without code if I can. Any ideas?

  • 1
    how are you building this url are you doing this from a button/ visualforce page? have you looked into URLFOR Function?urlfor('/001',''["id"="001abc","field1"="abc"]) salesforcesource.blogspot.com/2008/12/…
    – Rao
    Commented May 3, 2013 at 22:36
  • This is a Custom button... I saw URLFOR and tried to understand it in the Help files, but I don't quite understand it. Any advice on how to plug it into the example above to update multiple field values in the saveURL? Commented May 3, 2013 at 22:47
  • Did you face any issues like & in the values your passing through the URL hack and if yes how did you overcome them. Can someone help me as i am having a Script on custom button when clicked passing valued to a object. However, few of the picklist values have & in them eg: India & China its not working. Tried encodeURIComponent too, still facing issues. Any help would be appreciated.
    – Kiran
    Commented Oct 3, 2016 at 9:44

2 Answers 2


Easy :)

Just urlencode your params again. That way they'll get decoded when SF is examining your saveURL. For example:

  1. URL to make new Task: /00T/e?tsk5=Hi%20SF%20Stack!&tsk6=Look%20Ma,%20no%20hands!
  2. Go to http://meyerweb.com/eric/tools/dencoder/ or any other tool of your choice (URLENCODE function, javascript's encodeURIComponent... pick your poison).
  3. You should end up with something like %2F00T%2Fe%3Ftsk5%3DHi%2520SF%2520Stack!%26tsk6%3DLook%2520Ma%2C%2520no%2520hands!
  4. That's your saveURL.

The only problem is that this seems to somehow skip the code that generated "Recent Items" in the sidebar. So after I've saved an Account and I eventually end up on this new Task page, I don't see it in the sidebar. Only when I'll navigate to any other page it pops up.

enter image description here

  • does this apporach auto save @eyescream? after autopopulating the fields?
    – Rao
    Commented May 4, 2013 at 1:17
  • 2
    The derp is strong with this one... Commented May 4, 2013 at 8:10
  • @rao yes, just slap encoded save=1 at the end. Full URL to "show me new Acc page and on save make new Task" would be /001/e?saveURL=%2F00T%2Fe%3Ftsk5%3DAutosave%26tsk6%3DLook%2520Ma%2C%2520no%2520hands!%26save%3D1.
    – eyescream
    Commented May 4, 2013 at 8:33
  • @user320 You've started a fashion, you reap what you sow :)
    – eyescream
    Commented May 4, 2013 at 8:34
  • This looks great! Thank you for the idea! I'll try it out when I have some time in the next couple days! Commented May 6, 2013 at 23:09

Say for eg you are trying to auto populate the record when you are creating a new account

Every field has a ID and you can find that by inspecting the field in chrome

enter image description here

Paste the formula in the button script


$Action.Account.New - This represents the target URL

'' - this represents the ID and since we are passing most of the params throught the 3rd options lets ignore this [] - this is where you put in multiple params.

Just in case you want to update an account use:


enter image description here

If you want to autosave the records save="1" / save ="x"are not supported by SF/ not working as of today. The only alternative is using ajax refer the doc below:


Paste the below script in the button script area and choose option for behavior as " Execute Javascript"

var newRecords = []; 
var a = new sforce.SObject("account"); 
var accountid ;
a.name = 'Test_Pass';
accountid = a.id;
result = sforce.connection.create(newRecords);
if (result[0].getBoolean("success")) {
    alert('new account created with id ' + result[0].id);
  } else {
    alert('failed to create account '+ result[0]);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .