• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Filter widget with App Vars adding unwanted values

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

  • Filter widget with App Vars adding unwanted values

    Hello Team,
    I have an app that at one point is filtering a widget with app vars. I noticed it was not working correctly so I went to the logs and found the SQL statement for my widget. In the statement, the where clause does not look right. There is an extra 'N' character for some reason. This is what it looks like.
    "SQLSTMT": " SELECT F1.tocid AS F1_tocid, F1.Division AS F1_Division, F1.MSG1 AS F1_MSG1, F1.MSG2 AS F1_MSG2, F1.MSG3 AS F1_MSG3, F1.TRATSCode AS F1_TRATSCode, F1.TRATSDESC AS F1_TRATSDESC FROM Operations_Repo.dbo.TRATSDocLookup AS F1 WHERE (F1.TRATSCode=N'STRETCH WRAPPER ' AND F1.Division=N'68') ORDER BY F1.tocid DESC "

    My app vars are STRETCH WRAPPER and 68. I have no idea where that N is coming from. When I check the app vars in my helper programs, there is no N character. Any idea where that might be coming from?

  • #2
    Is this a remote data source for "SQL Server"?

    Thanks

    Comment


    • #3
      Yes it is. I have used this data source in other apps too.

      Comment


      • #4
        Are you absolutely sure the table contains records that have TRATSCode='STRETCH WRAPPER ' (note the space on the end) and Division='68'?

        That "N" prefix before the string is just telling SQL Server that what follows is in unicode.

        Comment


        • #5
          Ya, I went and looked at another app that is working and I see that N is there. So I now understand that is not the problem.
          Yes, 100% sure the SQL statement works because I can copy it to my management studio and execute the statement with results.
          There is still something going on. It starting to look more like a timing issue. I have a button that filters that same widget a second time and I'm noticing that it works on the second try with the previous app var. I'll try and get some more details to explain this better.

          Comment


          • #6
            I think I see what is happening.
            My button is filtering the forms widget. the form widget is set to auto-show. My form helper is being called before VVDATASRC. That is why the SQL statements are good and working, but when I'm watching my form helper program, it doesn't have the right values because VVDATASRC runs after the form helper.
            Does that make sense?
            https://screenrec.com/share/HX4kQBRf8O
            PRRV0003B sets a couple of app vars, then on success, filters my form.
            PRRV0001F is the forms helper.
            and then VVDATASRC is running afterward.
            It's a timing issue again.

            Comment


            • #7
              Next observation, I switched that widget to a pop-up widget, and now it runs VVDATASRC before the form helper so now I'm getting the expected behavior.
              However, I have a new problem. I think I start a new post for it.
              I would still like to get VVDATASRC to run before my form helper for non-popup widgets.

              Comment

              Working...
              X