URL Hack: Pass additional parameters into the saveURL

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


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

{!URLFOR($Action.Account.New,'',[acc2="test",acc5="123"])}

$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:

{!URLFOR($Action.Account.Edit,Account.Id,[acc2="test",acc5="123"])}

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:

http://help.salesforce.com/apex/HTViewSolution?id=000176169&language=en_US

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

{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")} 
var newRecords = []; 
var a = new sforce.SObject("account"); 
var accountid ;
a.name = 'Test_Pass';
accountid = a.id;
newRecords.push(a); 
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]);
  }window.location.reload();