TransWikia.com

How to access custom fields master table in developer console

Salesforce Asked by Nandy on October 3, 2020

We have integrated salesforce with our internal portal. On opportunity we have a field names Tags and there are certain values in it. When i use select Tags__c from Opportunity, i am getting only api names. How do i get the list of all labels in the Tags field? Is there a way to access the master table of the custom fields.

How to get the api name and label name in a single query?

Thank you in advance for the help

One Answer

If you need to be able to read and write the proper values, you need a describe object call (describeSObject). This is available in SOAP, REST, and the UI-API. For example, you could call /services/v48.0/sobjects/Opportunity/describe to get the describe information.

In any case, you'll get the field and all possible API values, and their respective labels to present to a user. If you just need a translated value directly from a query (read-only access), you can use SOQL's toLabel method:

SELECT toLabel(Tags__c) FROM Opportunity

Correct answer by sfdcfox on October 3, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP