This topic contains 5 replies, has 0 voices, and was last updated by tgrimm 8 years, 4 months ago.

  • Author
    Posts
  • #1999

    elie

    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:

    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.

  • #2000

    michoel

    I’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:

  • #2001

    elie

    Michoel, that sounds like a good suggestion, and coming from you I am assuming it works!

    How do you become a Freemarker expert?!? ๐Ÿ˜‰

  • #2002

    michoel

    Originally 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..

  • #2003

    elie

    The 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.

  • #2004

    tgrimm

    I 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.

You must be logged in to reply to this topic.