Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (13.1k points)
Is there any way to get the formulas from Salesforce formula fields? Using a CDATA drivers to connect Salesforce, but there is no such options to retrieve the formulas. Can anyone help me with this?

1 Answer

0 votes
by (26.7k points)
edited by

You can try using Metadata API. Below is an example to do that.

<CustomField>

    <fullName>Address__c</fullName>

    <externalId>false</externalId>

    <formula>BillingStreet &amp; BR() &amp; BillingCity &amp; BR() &amp;  BillingPostalCode &amp; BR() &amp;  BillingCountry &amp; BR() &amp;  Street2__c &amp; BR() &amp; Street3__c</formula>

    <formulaTreatBlanksAs>BlankAsZero</formulaTreatBlanksAs>

    <label>Address</label>

    <required>false</required>

    <trackHistory>false</trackHistory>

    <type>Text</type>

    <unique>false</unique>

</CustomField>

I hope this will work.

Want to know more about Salesforce? Watch this video on Salesforce Developer Training for Beginners:

Want to become a Salesforce expert? join Salesforce certification now!!

Browse Categories

...