You need to sign in to do that
Don't have an account?
getting some server url properties dynamically for related list custom button
Hi all,
I am creating a custom button on a related list off the Opportunity object. The button is to open the edit fields of a new related object and pass in a few default fields.
The code below works, but I want to try and avoid hard coding the '/a06/e?'string while building the URL. It does not appear to be part of the 'window.location.host'.....any advice how to get this dynamically would be appreciated.
Thanks
//define fields to obtain from Opportunity to be sent to the case edit page
var opptyName="{!Opportunity.Name}";
var oppty ="{!Opportunity.Id}";
var salesRep = "{!Opportunity.OwnerFullName}";
var leadUw = "{!Opportunity.Lead_UW__c}";
//define default fields to set for redirect
var opptyField = "CF00N300000039AI6="+opptyName;
var salesRepField ="&CF00N300000039QwI="+salesRep;
var leadUwField ="&CF00N300000039AIY="+leadUw;
top.location.replace("https://"+window.location.host+"/a06/e?"+opptyField+salesRepField+leadUwField+"&retURL="+oppty);