So i surfed a lot regarding this it but didn't found much relevant info,
Reference
https://developer.salesforce.com/forums/?id=906F00000008wdyIAA
Can I store my block of apex code as formula field and execute in apex
I want to know that can we use apex method in formula field to populate the same depending upon what apex method returns ?
so lets consider I have a global class
and global method
named as below respectively
emailProvider.getEmail(String a)
That takes a field value
(Name) as an argument and returns email
based on the argument
I want to use it as a formula field > emailProvider.getEmail(Custom_field__c)
.
I tried but getting error as Error: Unknown function emailProvider.getEmail Check spelling.
Note
Now i know we can use formula for this instead of using Apex method but, (Custom_Field__c) is already a CASE formula which calls for even another CASE formula hence broke the limit.
I would really appreciate any help
Thanks!