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

sendErrMsg doesn't display error?

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

  • sendErrMsg doesn't display error?

    Created my second application to edit a database file (grid). Added some error checking to several columns on "add" and "edit". While the code is preventing me from saving the record with errors, it is not displaying the error message dialog. What's odd is that this works just fine in my first application. I've tried IE and Chrome.


    RPG code is:
    sendErrMsg('invalid field':'XRAST2');
    return;

    Where XRAST2 is the physical fieldname in the database file.

    Is there something that I missed in Architect?

  • #2
    This seems to be working now except for the field "XRCOM#".

    Could this have something to do with the field name ending with a pound sign (hashtag)?

    Comment


    • #3
      Did you get this sorted out? It's possible the pound sign may indeed be throwing it off (in fact, I think Architect may complain about it). You could try removing the pound sign and see if that makes a difference. You'll of course need to adjust the field references on the back end -- i.e., "SELECT XRCOM# as XRCOM..." and VVIN_CHAR('XRCOM').

      Comment


      • #4
        Just encountered this again... using the SELECT FIELD# as FIELD does not seem to matter.

        Comment


        • #5
          Can you verify the JSON response coming back from the RPG program via the network tab on your browser's DevTools?

          Comment


          • #6
            I'm not sure if thisis what you are looking for or not:

            Uncaught Error: Invalid ComponentQuery selector: "#"

            BTW - I'm on version 5 now.

            Comment


            • #7
              That's a console error complaining about the pound sign. So it would appear that your RPG program is sending that pound sign back in the error response. If you click on the network tab of your dev tools and look at the response, what do you see? That would confirm it.

              Comment


              • #8
                OK... I found it:

                {"success":false,"msg":"invalid data","fld":"IMCOM#"}

                What is the "best" way to fix this? I have 3 fields in this table where the column name ends with a hashtag. I tried changing the SQL in my program to select them "AS" (i.e. Select IMCOM# as IMCOM, etc..) Then changed the column names in Store.
                Last edited by gwilburn; 11-11-2016, 01:59 PM.

                Comment


                • #9
                  I think you just need to modify the RPG program and recompile it. There must be a line that looks something like this:
                  sendErrMsg('invalid data':'IMCOM#');

                  So if you drop the pound sign from that second parm and recompile it then it should work as expected, assuming the front-end field name matches.

                  Comment


                  • #10
                    You are correct... I was able to fix this. I had to change it in the addRec, editRec, and getRec procedures.

                    Thanks for your help...

                    Comment

                    Working...
                    X