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
tonitonitonetonitonitone 

Help with commandButton URLFOR error

I've created a visualForce page for a custom object (SFDC_Enrollment__c) to be inserted into a section of a page layout of SFDC_Class__c (SFDC_Enrollment__c is the child of SFDC_Class__c), but the commandButton to create a new record is giving me a "Invalid parameter for function URLFOR" error

Here's the code --
Code:
<apex:commandButton action="{!URLFOR($Action.SFDC_Enrollment__c.New,Id,[retURL=URLFOR($Action.SFDC_Class__c.View,Id)])}" value="New Enrollment"/>

Then I tried omitting the parameters, and that threw an error too, but at least it'll work if the button is clicked as a standalone VF page when not as a inset of another page layout --

Here's the code for that --
Code:
   <apex:commandButton action="{!URLFOR($Action.SFDC_Enrollment__c.New)}" value="New Enrollment"/>

Any ideas?


Message Edited by tonitonitone on 08-08-2008 02:16 PM