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
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
1 Asked on November 11, 2021 by draccel
1 Asked on November 11, 2021 by andy-ray
2 Asked on November 11, 2021
0 Asked on November 11, 2021 by salesforce-development
2 Asked on November 8, 2021 by wowowjedipushing
0 Asked on November 8, 2021 by gaurav-thakur
4 Asked on November 8, 2021 by pavan-tej
lightning lightning aura components pagereference quickaction urlfor
2 Asked on November 8, 2021 by koustubh
1 Asked on November 8, 2021 by ericb
0 Asked on November 8, 2021 by sachi
api dataextensions marketing cloud marketingcloudapi rest api
3 Asked on November 8, 2021 by d_k
1 Asked on November 8, 2021
1 Asked on November 8, 2021 by sander-de-jong
1 Asked on November 8, 2021 by luke-higgins
1 Asked on November 5, 2021 by salesforce-tech-enthusiast
1 Asked on November 5, 2021
Get help from others!
Recent Questions
Recent Answers
© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP