• Eric@Appirio
  • NEWBIE
  • 5 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Is it possible to use variables in the key of an INPUTS parameter of URLFOR?

 

For example, using a Custom Settings variable:

<apex:commandButton action="{!URLFOR($Action.MyObject__c.New, null, [$Setup.CustomSettingName__c.CustomFieldName__c=controllerClass.Id])}" value="My Button" title="Button Title"/>

 

As you can see, the action for the commandButton is the URLFOR the New functionality of MyObject__c.

 

I am trying to pass in an input parameter where the parameter key is a  Custom Settings invocation, and the value is my controller class's Id variable.

 

When I try to do this, the the Custom Settings variable is not evaluated, instead the button treats it as a string literal and directs me to:

 

 

 

%24Setup.CustomSettingName__c.CustomFieldName__c=a0MT0000002NnCnABC

It just encoded the '$' sign and didn't evaluate the variable.

 

How can I use a variable as the key in the inputs parameter for the URLFOR function?

 

Much thanks

Message Edited by AlexPHP on 03-09-2010 06:49 PM