You need to sign in to do that
Don't have an account?

How to pass values to visualforce page
Hi,
I have create new 'abcd' button which is a standard button of 'abcd' object and when I clicked on that it launches my visualforce page. This object is added into opportunity page . Now what I want to do is whenever I click on create new 'abcd ' button, I want to pass opportunity ID to this visualforce page. How I can do that ?
Please let me know if my question is not clear.
Thanks,
Abhishek
I have create new 'abcd' button which is a standard button of 'abcd' object and when I clicked on that it launches my visualforce page. This object is added into opportunity page . Now what I want to do is whenever I click on create new 'abcd ' button, I want to pass opportunity ID to this visualforce page. How I can do that ?
Please let me know if my question is not clear.
Thanks,
Abhishek
this.acct = (Shipments__c)controller.getRecord();
also in the VF, you have to use your object name Shipments__c and not Shipment__c
http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_extension.htm
All Answers
if yes, then change the content source as URL in the button definition and add below template as URL
/apex/<yourpage>?CF<relation_id>={!Opportunity.Name}&CF<relation_id>_lkid={!Opportunity.Id}&sfdc.override=1
<yourpage> - your VF Name
<relation_id> - go to your object 'abcd', click on the Opportunity RelationShip field, in the URL you can see the relation_id.
If you dont have relationship with Opportunity on 'abcd', then you can just use below url
/apex/<yourpage>?oppid={!Opportunity.Id}
I do not see any URL option here.
This is like my 'abcd' button mentioned above for custom object.
I have added this object on opportunity page.
and whenever I click on this button it takes me to my visualforce page.
What I want is if I am clieck on this button from opportunity window, I should be getting opportunity id in my visualforce page.
Thanks,
Abhishek
if you override the new button, you dont need to do any thing. just add the opportunity relationship field in your VF.
it will get the name when you click the overriden new button from Opportunity.
So all you have to do now is add your relationship field using apex:inputfield in the VF. thats it
Problem is -
So there is a field in shipment object with name "Related_Opportunity" of type lookup and
there is nothing in opportunity which maps to Shipment.
Now I am not sure how I can write this relation in visualforce page.
My visualforce page already have this - Can you explain what kind of relation I need and how I can implement it. (Steps would be much better)
I appreciate your help in this regards.
Thanks,
Abhishek
it should populate the Opportuniy into your {!shipment.Related_Opportunity__c} field in your VF page
I treied and I got and I think its logical, because there is no shipment object right now when I click on new. How I can say give me shipment.Related_Opportunity__c if shipment itself is null.
Thanks,
Abhishek
in both case you should be using Shipment__c and not shipment.
where extension is my shipment apex class.
Alos wheb I used {!Shipment__c.Related_Opportunity__c}, it gave me error -
Thanks,
Abhishek
this.acct = (Shipments__c)controller.getRecord();
also in the VF, you have to use your object name Shipments__c and not Shipment__c
http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_extension.htm