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
akshay desai 9akshay desai 9 

BUTTON IS ON RELATED PAGE HOW TO GET ID THEN on VISUALFORCE

My list button is on CampaignMember button but i am accessing this button from campaign object related list
so i am getting error
Id value 7018A000000ITTu is not valid for the Campaign Member standard controller

I just started to write code so its just like this
<apex:page standardController="CampaignMember" extensions="ForSaleLookupOnCampaignController" action="{!routeToFlow}"> 
    <apex:form> 
        For Sale :
<apex:inputfield value="{!CampaignMember.For_Sale__c}"/>   
        <apex:commandButton value="Save"/> 
    </apex:form> 
</apex:page>
public class ForSaleLookupOnCampaignController { 
        public ForSaleLookupOnCampaignController (ApexPages.StandardController standardControllerParam) {
  
}
}


 
ANUTEJANUTEJ (Salesforce Developers) 
Hi Akshay,

Can you try to check if this is working when you are accessing this from the campaign member page doing this we can check if the particular field is not accessible from the campaign object.

Regards,
Anutej