Announcement

Collapse
No announcement yet.

Map variable not defined error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Map variable not defined error

    I have a Javascript database writer destination defined as follows:

    var dbConn = DatabaseConnectionFactory.createDatabaseConnection ('net.sourceforge.jtds.jdbc.Driver','jdbc:jtds:sql server://sqlmonkey1:1433/Meditech','ppscript','pay4us');
    var result = dbConn.executeUpdate("INSERT IGNORE INTO CedaronBillingPat (ACCTNUMBER,RECORDSTATUS) VALUES ('" + $(anumber) + "','new')");

    dbConn.close();


    I get ReferenceError: "anumber" is not defined.

    I have an identical transformer on another destination using SQL which works fine. I assume that the statement is executing before $(anumber) receives it's value but can't figure out how to fix it. Please help!

  • #2
    Re:Map variable not defined error

    I think you have to put anumber between quotes
    It should be $('anumber')

    Comment


    • #3
      Re:Map variable not defined error

      That does work. Thank you very much!

      I was dragging and dropping the $(anumber) from the destination mappings and assumed it should work without intervention as it does when Use Javascript is No. Perhaps that should be a future enhancement.

      Comment


      • #4
        Re:Map variable not defined error

        Interesting...that's a bug. I will fix it for the next version. I wonder how no one has caught this until now.
        Brendan Haverlock | Mirth Software Engineer | Mirth Corporation

        Comment


        • #5
          Re:Map variable not defined error

          I have the same problem with version 1.6. With that version is solved?

          Comment


          • #6
            Re:Map variable not defined error

            It's fixed for 1.7, which will be out shortly.
            Jacob Brauer
            Director, Software Development
            NextGen Healthcare

            sigpic

            Comment


            • #7
              Re:Map variable not defined error

              Ok. Thanks.

              Comment

              Working...
              X