Search code examples
logicsugarcrmsuitecrm

SugarCRM Logic for Adding VAT to Total Cost if Checkbox Checked


I’m new to SugarLogic and SugarCRM. I’m trying to add logic to a field. Basically I have a VAT checkbox field and if it’s ticked I want the total cost field to be multiplied by 23%. If its not ticked, then VAT isn’t added. I will be grateful for any help given. The below code will not work for me.

ifElse(equal($vat_applicable,true),multiply($total_cost,0.023))

Thanks x


Solution

  • Since this is an “if/else” SugarLogic function, you need to complete the rest of the formula (else). Add this formula to the 'total cost' field.

    ifElse(equal($vat_applicable,true),
        multiply($total_cost,0.23),
        $total_cost
    )