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
Just Code ItJust Code It 

Master Data Implementation

Hi All,

I come from custom app development (Java, .NET etc.) and new to Force.com platform. I have one custom object named "Country Code" with two fields ID and Description (ID = US, Description = "United States", for example). I would like to display the value in the "Description" field as drop-down in Account object, in the "Country" field of the Account object. I also need to send record in in Account object to external application (via Web Services, for example). However, the value of he "Country" field in Account object needs to be from "ID" field, not from "Description" field.

The Lookup field is the closest I found but it does NOT allow to display in drop-down. Standard Piclist does not provide a method to include the "ID" value as well.

This seems to be a common programming problem, is there any standard mechanism supported by Force.com? Or is there any design pattern that can be recommended? I was looking at metadata API to create custom solution for Picklist, any advise?

 

Thanks in advance,

Best Answer chosen by Admin (Salesforce Developers) 
Ritesh AswaneyRitesh Aswaney

It is not possible currently to have a picklist field sourcing values from another object - not via the Standard Salesforce Edit screen anyway.

 

You can visualforce a section, which displays your custom picklist as sourced from your cross-object field. If you want persisted value to be different from the displayed value, then this is something you could do in your controller (possibly an Account Controller Extension)

All Answers

Ritesh AswaneyRitesh Aswaney

It is not possible currently to have a picklist field sourcing values from another object - not via the Standard Salesforce Edit screen anyway.

 

You can visualforce a section, which displays your custom picklist as sourced from your cross-object field. If you want persisted value to be different from the displayed value, then this is something you could do in your controller (possibly an Account Controller Extension)

This was selected as the best answer