+ Start a Discussion
RDN_LHRRDN_LHR 

What's wrong with this URLFOR??

I've looked up as many examples of URLFOR as I can find, and I think I'm following them nicely, but I'm getting an error when I try to save the S-Control that says Syntax error.  Found '['
 
I'm putting the [ just where it seems it should go in the examples.  Can anyone tell me what the problem is then with this thing??
 
thanks!!!
 
 
window.parent.location.href="{!URLFOR($Action.Project__c.New, null,[00N20000001AgKn=Case.Workstation_Product__c,00N20000001Aelf=Case.LastModifiedDate,
CF00N20000001Aels=Case.Related_Opportunity_Name__c,
00N20000001AgKr=Case.Workstation_Product_Version__c,
CF00N20000001Aelp=Case.Business_Contact__c,
CF00N20000001Aell=Case.Opportunity_Account__c],null)}"
mschmidtmschmidt
Hi,

I think your problem is not the bracket but the last parameter of the URLFOR function. This needs to be true or false. Have a look on the documentation aswell:
http://na5.salesforce.com/help/doc/en/customize_functions.htm#URLFOR


Code:
window.parent.location.href="{!URLFOR($Action.Project__c.New, null,[00N20000001AgKn=Case.Workstation_Product__c,00N20000001Aelf=Case.LastModifiedDate,
CF00N20000001Aels=Case.Related_Opportunity_Name__c,
00N20000001AgKr=Case.Workstation_Product_Version__c,
CF00N20000001Aelp=Case.Business_Contact__c,
CF00N20000001Aell=Case.Opportunity_Account__c],true)}"

Hope that helps.

Cheers,
Matthias

RDN_LHRRDN_LHR
I got the "null" from documentation and I've tried it with "true" as well and I still get the [ error.
MRutterMRutter

Have you fixed this yet?

 

I could not pass values to custome fields (field IDs with leading zeros) inside the [] brackets.  I had to do the following:

 

<script type="text/javascript">

window.parent.location.href="{!URLFOR($Action.Activity.NewEvent,null,
[retURL=URLFOR( $Action.Contact.View, Contact.Id)]
)} &00N80000002rqFh=Here&RecordType=01280000000EpvV&type=Event&setupid=EventRecords";

</script>

 

Mark

JWSJWS

I know this is a late solution here, but I think the problem is that you're missing a "CF" on one of these (added in red).  I was running into this same problem and this did the trick.

 

CF00N20000001Aell=Case.Opportunity_Account__c],null)}"

window.parent.location.href="{!URLFOR($Action.Project__c.New, null,[CF00N20000001AgKn=Case.Workstation_Product__c,00N20000001Aelf=Case.LastModifiedDate,
CF00N20000001Aels=Case.Related_Opportunity_Name__c,
CF00N20000001AgKr=Case.Workstation_Product_Version__c,
CF00N20000001Aelp=Case.Business_Contact__c,