I encountered many instances where I have a field in Production and the same field in the Sandbox, and I try running a comparision in Freemarker for the value stored in the field, but for some reason I am getting different responses in each environment.
The funny thing is the following: I understand that there could be some sort of change to the way the system reads in custom fields, but this is happening with core, built-in Netsuite fields as well.
For example, with checkbox fields, I attempted to run formulas such as:
<#if CUSTOMFIELDHERE
I received some sort of error when attempting this check, so I modified it to:<#if CUSTOMFIELDHERE == "T"
All of the sudden Netsuite's compiler was happy. Now, I copied it over to Production, and all of the sudden the compiler was not happy with the results, and made me switch it back to the first syntax above, and all checked out.The same occurred with built-in Yes/No fields, such as istaxable. We want to print a "T" next to the price on our invoices, so I added a line of code that reads:<#if item.istaxable><span>T</span></#if>
The funny thing is that when I opened an invoice, all was fine. When I tried opening another invoice on the same template, I received an error:The template cannot be saved due to the following errors:
The only legal comparisons are between two numbers, two strings, or two dates.
Left hand operand is a com.netledger.templates.model.BooleanModel
Right hand operand is a freemarker.template.SimpleScalar
Actually, that error I overrode, saved it, and reloaded the invoice and hit print and received the above error in the browser.Switching the code back to the following, yielded another error:<#if item.istaxable == "T"><span>T</span></#if>
Error:Expecting a boolean (true/false) expression here
Expression item.istaxable does not evaluate to true/false
it is an instance of com.netledger.templates.model.StringModel
This is weird, and is troubling. Any suggestions???