So here is an odd question. On our Opportunity object we have a formula field. Is there anyway to pull in the actual formula calculation through any API, APEX, REST, SOAP? I have an iOS app and a requirement is to have the UI update according to the formula. My only option at this point seems to be copying that formula to the client-side, but then if it ever changes then the app needs to be updated as well. However, if I could pull in the formula from Salesforce then I could dynamically generate it. So is it possible?
Sure it's possible. The
DescribeSObjectResult response in the SOAP API includes an array of
Field objects, and formula fields will have a
formula key that contains the formula for that field.
Of course, parsing that formula into logic your client can evaluate is an entirely different massive undertaking, but the foundation is there...