You need to sign in to do that
Don't have an account?
Ben Merton 17
How to refer to a text field to drive a formula?
I am trying to create a quite complicated set of objects to drive tax (similar to SAP).
The basic idea is that every tax should have a corresponding formula that defines how the tax is calculated when it is used on another object. For example, if you may have a tax which is applicable on the base amount or it may be cumulative based on other taxes.
I therefore need to be able to use variables within a formula, but I want this to be configurable by a user. The best idea I can think of is to use a simple text field in the record of the tax that defines the formulas for how this tax would work on a given object in standard Salesforce point-and-click formulas.
For example, in a text field (called Tax Formula) on the tax record, it would specify something like:
If (Object_Name__c=PO_Line_Item,
TaxAmount__c=TaxRate__c*BaseAmount__c,
TaxAmount__c=TaxRate__c*(BaseAmount__c-WithholdingTaxAmount))
In the PO Line Item object, I would then want to be able to pull in this point-and-click code and run the formula whenever a record is created.
Is there a method / wrapper or some other type of class that allows the incorporation of standard point-and-click formulas to execute logic?
The alternative to this is that you have to create a custom formula field for every tax scenario for EVERY country that you plan to deploy in.
Any ideas?
The basic idea is that every tax should have a corresponding formula that defines how the tax is calculated when it is used on another object. For example, if you may have a tax which is applicable on the base amount or it may be cumulative based on other taxes.
I therefore need to be able to use variables within a formula, but I want this to be configurable by a user. The best idea I can think of is to use a simple text field in the record of the tax that defines the formulas for how this tax would work on a given object in standard Salesforce point-and-click formulas.
For example, in a text field (called Tax Formula) on the tax record, it would specify something like:
If (Object_Name__c=PO_Line_Item,
TaxAmount__c=TaxRate__c*BaseAmount__c,
TaxAmount__c=TaxRate__c*(BaseAmount__c-WithholdingTaxAmount))
In the PO Line Item object, I would then want to be able to pull in this point-and-click code and run the formula whenever a record is created.
Is there a method / wrapper or some other type of class that allows the incorporation of standard point-and-click formulas to execute logic?
The alternative to this is that you have to create a custom formula field for every tax scenario for EVERY country that you plan to deploy in.
Any ideas?
All Answers