Get data type, not display type, Salesforce.com fields from Apex

I need to access the field data types in the Salesforce.com object to identify each telephone, fax, email, and mail field in the object. I did this from SFDC web services by calling DescribeSObject, but the Apex method DescribeFieldResult.getType returns the display type of the field, not the actual data type.

For example, the fields displaying the type of fax data, as in the image below, have the type of displaying the phone in accordance with the getType call. I need something that returns a fax for fax fields, mail for mail fields, etc., How to call the DescribeSObject web service. Anyone if this exists in Apex?

Field information

+3
source share
1 answer

Unfortunately, APEX does not have this information. However, since you can only define custom phone and email fields, not fax and mail / address fields, you can write a final list of all fax and mail fields. Thus, you can think of hard coding, the fields of which are fax / mail fields and dynamically figure out which fields use telephone and mail fields, use the calls to describeFieldResult.getType ().

+1
source

Source: https://habr.com/ru/post/1727399/


All Articles