I'm trying to get the following to work in a formula field.... If({!contract__uom_}=="BX") return {!contract__uom_price_} If {Contract UOM} = "BX" then insert the {Contract UOM Price} or If {Contract UOM} = "CA" then insert the ({Contract UOM Price} * {Box/Case}) thanks for any help or advice
Hi,
Your syntax seems to be correct except for a few:
For:
If({!contract__uom_}=="BX")
return {!contract__uom_price_}
You'll have to instantiate your tokens into String objects if your evaluating them as strings. Below:
If( "{!contract__uom_}" =="BX")
return {!contract__uom_price_};
For this scenario, Just make sure that in your formula return type, you'll specify it as a Integer or a Decimal since im assuming {!contract__uom_price_} is a Number field. If it is not, then your return type should be different and you'll have to declare {!contract__uom_price_} as a JS object as well.
Something like:
- '{!contract__uom_price_}' = String object
- new Date('{!contract__uom_price_}') = Date object
Hope this helps,
Piscoso Martin
Rollbase PH
Got it. Thanks Martin.