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
Ines Daboub 9Ines Daboub 9 

custom action and Visualforce pages

Hello,

I want to use $Action with a custom action that I've created.
Here is my code :
<apex:page standardController="Lead__c"> 
    <apex:form >
        <apex:pageBlock title="Créer un Lead">
             <apex:selectRadio layout="pageDirection">
                <apex:selectOption itemLabel="Nouvelle Affaire" itemValue="1"></apex:selectOption>
                <apex:selectOption itemLabel="Propal, DRI, Avant-vente" itemValue="2"></apex:selectOption>
                <apex:selectOption itemLabel="Renouvellement d'affaire" itemValue="3"></apex:selectOption>
        </apex:selectRadio>
            <apex:commandButton action="{!URLFOR($Action.Lead__c.Propal)}" value="Enregistrer" /> 
        </apex:pageBlock>
    </apex:form>
</apex:page>

Lead is a custom objet and Propal is a custom action.
Can anyone help me ?
Thanks !

Inès
Alain CabonAlain Cabon
Hello,

Why don't you use just "{!save}" (puisqu'il s'agit du bouton "Enregistrer" et d'un contrôleur standard) ?
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_commandButton.htm (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_commandButton.htm?search_text=command)

Without an Apex custom controller or an Apex extension, the only actions permitted are the standard action listed here:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_action_valid_values.htm

Have you created an Object-Specific Quick Action?
After you can just customize its layout, add predefined values, and then add the action to page layouts.
https://resources.docs.salesforce.com/204/latest/en-us/sfdc/pdf/actions_impl_guide.pdf

Regards,

Alain
Ines Daboub 9Ines Daboub 9
Thanks a lot Alain !