formula example

Posted by Rollbase User on 29-Mar-2012 16:45

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

All Replies

Posted by Admin on 29-Mar-2012 19:22

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

Posted by Admin on 30-Mar-2012 11:12

Got it. Thanks Martin.

This thread is closed