This topic contains 5 replies, has 0 voices, and was last updated by tgrimm 8 years, 4 months ago.
-
AuthorPosts
-
June 21, 2016 at 8:16 am #1999
elieI 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:
Code:
T#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:
Code:
T#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???
This is a cached copy. Click here to see the original post. -
June 21, 2016 at 6:14 pm #2000
michoelI’ve seen something similar before, actually in the same account item.isclosed was boolean in some record types and T/F in others.
A work-around is:
Code:
-
June 21, 2016 at 6:19 pm #2001
elieMichoel, that sounds like a good suggestion, and coming from you I am assuming it works!
How do you become a Freemarker expert?!? ๐
-
June 21, 2016 at 7:03 pm #2002
michoelOriginally posted by elie
View Post
Michoel, that sounds like a good suggestion, and coming from you I am assuming it works!
How do you become a Freemarker expert?!? ๐
Haha, too much trial and error..
-
June 22, 2016 at 11:13 am #2003
elieThe real question is, Freemarker syntax aside, why in the world Netsuite would be assigning booleans strings and vice versa, inconsistently! The same was true with our account(s) after looking further, even within Production or Sandbox respectively, some records posed an issue, others not.
I opened a case with Netsuite… let you know what comes of it.
-
July 6, 2016 at 8:53 am #2004
tgrimmI feel it might also have something to do with the interpretations of the underlying xml. From time to time i see booleans treated as ‘T’ and ‘F’, other times they are true and false. I haven’t yet in the past attempted to compile the evidence into any quantifiable assumptions as to what causes each case, but I will start paying better attention and hopefully we can get to the bottom of this oddity.
-
AuthorPosts
You must be logged in to reply to this topic.