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
GrahamGraham 

Data Model Viewer

Quick question. I'm looking to add the Data Model Viewer to an app to aid in Mapping Fields. By this I mean we take info from a Salesforce.com field (e.g. User's Email address) and put it into one of our fields, with a different name.

SO, it would be helpful when making these mappings to be able to browse the data tree and select fields. I know on the sforce sourceforge site it says the source will be available soon for the SOQL explorer, any ideas on when? Any suggestions on an easy way to implement this?

Thanks,

Graham
DevAngelDevAngel

Hi Graham,

The data model viewer is simply a tree control in a user control.  It is initially populated with the results from a describe call.  Each node at the "root" level has a dummy node to cause the plus sign to show.  When the node is expanded, the number of children is checked to see if it is one, and if so, the child is removed, a call to DescribeSObject is called and the results are processed into child nodes of the "root" for the object.

It is a pretty simple pattern that is easily implemented.  I actually just dropped in the user control into the Partner sample on source forge.  You would probably want a slimmed down version for your use (don't know if you need all the available metadata).  If you really, really, really want to see the source for that let me know and I'll see what I can do.

Cheers

GrahamGraham
Hi Dave,
Thanks for getting back to me. Of course I don't NEED to see the source, but since I will be using the metadata (need to know picklist options, if it's queryable/updateable, etc.) I thought it would be nice to use that interface. Either way, thanks for the help.

Best,
Graham
Gagan.ax66Gagan.ax66

Hi Dave

I have seen this utility and it works fine.
please provide me the source for the utility.

Thanks and regards,
Gagan 

DevAngelDevAngel

Ok, ok, my arm has been twisted.  The code you seek is or will be up on source forge within the hour.  Use at your own risk.  Neither I nor salesforce.com make any warranties or imply any fitness for use in production.  The code is one implementation of a possible gazillion.  There is no documentation or support (although feel free to post suggestions and "good ideas").  Included in this sample code is an in-place editing data grid implementation.  Be careful, there are no prompts to give you a chance to cancel a data edit (can't remember if I included delete capability, so check the code carefully).  You should be able to grab the Data model viewer control and rewire into your app.