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
LoltLolt 

Can not initialize all fields with URLFOR Action...New

I have a client with Professional edition so I don't have access to the API.  So, the S-Control I created to do this includes following code:
 
 var newURL = "{!URLFOR($Action.CPS_Client__c.New)}" +
                     "&Name="  + CPSName +
                      "&CF00N70000001xdT6=" + CPSName +
                       "&O0N70000001xOpt=" + FirstName +
                      "&O0N70000001xOpo=" + Lastname;
 window.parent.location.href = newURL;
 
 
The URL created and moved to is:

https://na5.salesforce.com/a06/e?retURL=%2Fservlet%2Fservlet.Integration%3FscontrolCaching%3D1%26lid%3D00b70000000qhlV%26eid%3D0037000000Vi0It%26ic%3D1&Name=Lolt%20Proegler&CF00N70000001xdT6=Lolt%20Proegler&O0N70000001xOpt=Lolt&O0N70000001xOpo=Proegler

While fields "&Name" (standard field) and "&CF00N70000001xdT6" (Detail-Master link) are initialized properly,  the two 'custom fields'  "&O0N70000001xOpt" and "&O0N70000001xOpo" are both required and both are empty.

Are there special rules covering which parameters can be passed via URLFOR? or have I made some other error?

Thanks

 

 


 
GanuGanu
Hi,
 
Try to give the fields within single quote ex:
 
 var newURL = "{!URLFOR($Action.CPS_Client__c.New)}" +
                     "&Name="  + CPSName +
                      "&CF00N70000001xdT6=" + CPSName +
                      'O0N70000001xOpt=' + FirstName +
                      'O0N70000001xOpo=' + Lastname;
 window.parent.location.href = newURL;