You need to sign in to do that
Don't have an account?
EPSWDEV
Dynamic Visual Force Page with details of different custom object.
Hi, I am trying to create a Visual source page which as two sections - Sec1 and Sec2. Sec1 display's the detail of lets say CustomObj1.
CustomObj1.field1 is a picklist of different custom objects and depending on the value chosen, I want the second section to display details of custom object chosen. for eg is Accounts was chosen display account detail feilds, if contact then contact detail.
whats the best way to do this?
I am implementing a component for sec2 that takes in the custom object type selected then dispaying the detail for that object however i find that I cannot specify object to a <apex:detail> tag. what are my options here.
thanks,
CustomObj1.field1 is a picklist of different custom objects and depending on the value chosen, I want the second section to display details of custom object chosen. for eg is Accounts was chosen display account detail feilds, if contact then contact detail.
whats the best way to do this?
I am implementing a component for sec2 that takes in the custom object type selected then dispaying the detail for that object however i find that I cannot specify object to a <apex:detail> tag. what are my options here.
thanks,
however, in order to do so you will need an object Id as well. Unless you are redirecting the user to object's detail page for creating a new record (Action.New).
Check the below link for more information:
http://salesforcesource.blogspot.com/2008/12/urlfor-function-finally-explained.html
http://salesforcesource.blogspot.com/2008/12/urlfor-function-finally-explained.html
Message Edited by Sam.arj on 01-06-2009 09:57 AM
I cannot redirect the user to a different page. The functionality intended is to show all the relevant details on the same page and when the user hits save I will be saving data to respective objects.
thanks,
So, you can do this
Not sure if I can do that, I should have mentioned in the initial post that CustomObj.Field1 is a textfield that just contains the name of custom object type . eg CustomObj.Field1 = MyCustomObj1__c.
What I am looking for is a way to create a object of type --> MyCustomObj1__c at runtime and then display the field. My biggest challenge right now is I cant event create a object that way.
you start by making a call like this :
and then loop over the keys until you find one that matches your string, then you have the Schema.SObjectType you need to perform a field describe.
i'm not sure you can bind a dynamic sobject field to a visualforce inputField , have not tried that. You should be able to bind it to an inputText or Select list, but you may have to fetch the values using dynamic describe information.
details here:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_describe_objects_understanding.htm
Message Edited by Ron Hess on 01-06-2009 12:29 PM
Is sObjectType methods explained anywhere?
Message Edited by dchasman on 01-07-2009 09:31 AM