You need to sign in to do that
Don't have an account?
Clifford
Retrieve the picklist value "id" using the API
Is there a way to get the "id" of a picklist value through the API? We are using picklist values in an external system and when a picklist value is updated, would like to "push" this updated value to the external system via the id.
Looking at the edit page, it seems it may be possible to get at the id, but I do not see this available through the API. Is there a way to get this id value?
Examples through the edit screen:
picklist_masteredit.jsp?id=01J400000088LJZ
picklist_masteredit.jsp?id=01J400000088LJa
Thanks!
I am still a little unclear on why you need the ID (which as you found out, is not exposed...which is on purpose). A picklist is keyed off its text value. So if you want to add a new picklist value through the metadata api, you provide a text field. NOTE - you can not edit or delete picklist values through the metadata api currently.
All Answers
Are you looking to get the picklist value selected for a given record? Or are you looking for the list of possible Picklist values as configured for a given field? The reason I ask is because you access those values differently thorugh the API.
If you just want the selected value for a given record, the value is set on the field itself.
But if you want to get all the possible picklist values, then you need to use the Describe API.
I am still a little unclear on why you need the ID (which as you found out, is not exposed...which is on purpose). A picklist is keyed off its text value. So if you want to add a new picklist value through the metadata api, you provide a text field. NOTE - you can not edit or delete picklist values through the metadata api currently.
We are trying to do a one way sync of data from SFDC to an external system. Initially we would have the same values in SFDC and the external sys...and say one value in the picklist is "Shoe" and it gets updated to "Shoes". In the external system we are using relational tables, so if we have an order table, with order items, we would have the id value for "Shoe" in the related tables. Now, when the new value "Shoes" comes over from SFDC, we need a key or id (unless there is an alternative) to know that "Shoe" in our system needs to be updated to "Shoes".
Sounds like, since the id is not avail through the API, nor can we edit picklist values through the API, that we can not implement a fully automated solution as outlined above....
Well, at the metadata layer (ie the configuration of the picklist values), you won't get the picklist value IDs amongst some of the other limitations.
But if you are sync'ing the data (ie the order, order line items), you will get the record IDs for those records and would use the standard Web Services API (ie query, insert, update, delete) and not the metadata API.
I'm wondering if anyone else has other thoughts on this?
I need to replicate a pick list in another system and without knowing what a picklist item's ID is, I can't figure out how to handle edits to the picklist item.
I understand that in the metadata layer the ID is not exposed. Is there another layer that I could query where it would be exposed?
Or, is there an audit log for picklists somewhere that I could monitor for edits?
Any other ideas?
hi i have woring on METADATA Api
and i have successfully create soap envelope to add new picklist value in picklist field
via
Now issues I am facing , is
Is there any way to update / edit any particular picklist value ???
e.g , Object : Lead , field : number__c, type : picklist , picklist values : new , old
any way i can edit "new " to "new_value" via meta data API .
Thanks to soap and metadata api developers in advance
Jason, Clifford - were you ever able to get an answer to this question? I ask, because I'm faced wtih the same challenge you are.
We are doing a one-way data sync from salesforce to our relational system, and I need some way to understand if the values "shoe" and "shoes" actually represent the same picklist item (if/when someone has gone in to SalesForce and edited "shoe" to become "shoes").
Without an ID, "shoe" and "shoes" will look like two separate picklist items ... which will turn into two separate rows in our relational system ... which is not what we want.