Matt Limb

IF Formulas

Discussion created by Matt Limb on Feb 22, 2018
Latest reply on Feb 23, 2018 by Matt Limb

Hi we have a simple formula for calculating a warranty expiry date in one of our modules:

 

addDays(related($tsr_invoices_tsr_invoice_products,"invoice_date"),$warranty_days_to_add_c)

 

I would like to add to the formula so that it only calculates the date if there are days to add otherwise it leaves the date field blank? Struggling.  Tried this:

 

ifElse(greaterThan($warranty_days_to_add_c,"0"),addDays(related($tsr_invoices_tsr_invoice_products,"invoice_date"),$warranty_days_to_add_c))

 

but keep getting an error saying 'args[2] is undefined'. I believe that means i havent stated what to do if it equals 0 but really not sure.

 

Im not a programmer or anything so as simple as possible please

 

Any help would be much appreciated.

 

Thanks

Outcomes