You need to sign in to do that
Don't have an account?
Sfdc_beginner
Is it possible /advisable to update two custom objects using a single custom controller ?
HI There,
I am new to Salesforce, I just want to know if it is possible to update two custom objects using a single custom controller (From Visual Force custom page) ? Is it advisable ? If Yes, please share an example .
And one more thing, how to create a look field in a custom VF page and how to populate the values from a lookup field in a custom object ?
Thanks in adavnce :)
Custom controllers can certainly be used to update multiple SObject types - custom or standard. Standard controller extensions can also do this.
For an example of a custom controller that updates multiple SObject types - see VF Dev Guide here: http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_quick_start_wizard.htm
Be sure to use try-catch blocks in your controller around DML statements
Thanks Eric !
How about my 2nd question ?
How to create a look field in a custom VF page and how to populate the values from a lookup field in a custom object ?
Please share an example
Thanks in advance
Also , to populate values in Lookup field ,you need to pass expected Record Id to the lookup field . As Lookup can only be referenced through Ids for relating two objects .
HI Mayank,
Thanks .
Request you to share an example code.
Allows for a lookup field just like in standard SFDC page layout for the Opportunity's possible accounts (governed by any lookup filters defined in the Force.com UI
If you are trying to implement a custom lookup button, please read this: http://bobbuzzard.blogspot.com/2010/09/visualforce-lookup.html