Hi,
I want to compare two fields on the email template and put it under the IF function.
I created a custom field type integer number called "custrecord_today_date" that calculates the difference between the warranty end date field and today's date. The formula for this custom field is:
"ROUND(({custrecord_warranty_end_date}-{today}),0)".
For example, when I put {custrecord_warranty_end_date}= 12/06/2023, I get on this field the result "-2".
Now I want to create if on the email template to check if the custom field I created is less than 0 or greater than 0.
I tried to use the below syntax on the email template, but I get the below error when trying to save-
<#if customrecord.custrecord_today_date < 0> Safeguard your machine with extended coverage before your warranty expires in X days.</#if><br />
The error: Can't compare values of these types. Allowed comparisons are between two numbers, two strings, two dates, or two booleans.Left hand operand is a Sequence+hash+string(wrapper: com.netledger.model.EmptyModle)..Right hand operand is a number (weapper:f.t.SimpleNumber)..The blamed expression: ==> customrecord.custrecord_today_date < 0 [in template "content" at line 15, column 6]..----,FTL stack trace ("~" means nesting-related): Failed at: #if customrecord.custrecord_today_date < 0
Can you please assist how I need to use less than function on the email template?