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
MohanaGopalMohanaGopal 

Custom list button invoke VF page

Hi...
   I have created one custom list button. When I clicks I want to invokes one visualforce page...
 
Now I am using
 Content Source: Onclick javascript
 
in script
window.location.href = 'orgid/apex/myvfpagename';
 
Visual Force Page
 
Standard controller is ="Calculated_Measures__c"
Parent object is =Project__c
 
In my VF I am using =
 <apex:inputField id="CurrentProject" value="{!Calculated_Measures__c.Project__c}"/>
 
But it shows blank in UI...
 
I am also try
 
window.location.href = 'orgid/apex/myvfpagename{mergefield parent Id}';
In the url parent id is doesnt appear...
 
My question is how to pass parent object id to the visual force or how to access parent id in that vf page..
 
I need to display Name of parent object ,, But that is custom list button
 
Any one send sample code for this....
 
 
 
Ron HessRon Hess
try
 
window.location.href = '/apex/myvfpagename?id={mergefield parent Id}';
MohanaGopalMohanaGopal
Id value is not valid for the Calculated_Measures__c standard controller
 
I got the above message when I use onclick java script
 
window.location.href = '/apex/myvfpagename?id={!Calculated_Measures__c.Project__c}';
 
I am also try
 
window.location.href = '/apex/myvfpagename?id={!Project__c.Id}';
 
Here Calculated_Measures__c -- Child object
 
Project__c -- Parent object..
 
It has master detail lookup..
 
    Any one give some sample code for accessing parent object id and fields from related list custom button or new button override...
 
    Because based on the parent id  I have to do some calculations....
 
 

 
Ron HessRon Hess
it's probably Calculated_Measures__r

look up the relation name in the object detail page to be sure.
if you have eclipse, you can also use the schema browser to see the child relation names.
MohanaGopalMohanaGopal
Can u send sample code for it
  
Please read my issue once again...
 
How to access parent id... I dont know how to implement ur code....