Send an AGS call from a Self Service Screen

Sort:
You are not authorized to post a reply.
Author
Messages
J.W.
Basic Member
Posts: 7
Basic Member

    We have several customizations that send AGS calls from a ESS form.  Prior to 9.0, this would work with the following:

     

             // build ags call for effective date validation
             var vAGScall = "?_PDL=" + authUser.prodline;
             vAGScall += "&_TKN=ZZPS.1&_LFN=ALL&_RTN=DATA&_TDS=IGNORE&_OUT=XML&_EVT=CHG&FC=I";
                     vAGScall += "&FR-DATE=" + vDate + "&ERROR=Z&_EOT=TRUE";

             // send ags call to the server
             var vAGSInfo = top.httpRequest(top.AGSPath + vAGScall);
             if (vAGSInfo.status){
                 alert("Error in AGS call to check for payroll sunday.");
                 return false;
             }

    Now on LSF9 this call fails with a javascript error 'access denied'.  I know there are some API's for authenticating with LSF9, but should I need to use those considering this is coming from a session that is already authenticated?  Also, I'm guessing the top.httpRequest no longer works.

    Any input on how to make this work in the new world?

    Thanks,
    JW

    John Henley
    Senior Member
    Posts: 3348
    Senior Member
      I'm guessing that your "access denied" Javascript error has nothing to do with security. The issue is probably that both the AGS syntax as well as the location of the user variables/properties have changed. During your LSF9 migration, your Design Studio pages should have been run thru an upgrade utility which changed these things. For example, you now get the prodline from portalWnd.oUserProfile.getAttribute("ProductLine"). Stick an alert(vAGScall) before the AGS call is executed and paste the AGS call into the browser and see what happens...
      Thanks for using the LawsonGuru.com forums!
      John
      J.W.
      Basic Member
      Posts: 7
      Basic Member

        Actually the AGS call is getting built correctly.  The variables work fine (I have alerted it to death and see the transaction as it should be).  The access denied error happens when it is submitted.

        John Henley
        Senior Member
        Posts: 3348
        Senior Member
          Try changing:
          var vAGSInfo = top.httpRequest(top.AGSPath + vAGScall);
          to:
          var vAGSInfo = portalWnd.httpRequest(portalWnd.AGSPath + vAGScall);
          Thanks for using the LawsonGuru.com forums!
          John
          J.W.
          Basic Member
          Posts: 7
          Basic Member

            I get "portalWnd" is undefined. 

            Should I be declaring that somewhere?

            John Henley
            Senior Member
            Posts: 3348
            Senior Member
              Oh, sorry. I thought this was Design Studio modification (I'm going to move it to the "customization forum".
              You should probably look at one of the xhrnet .js files and steal that code (look at dr.js as a good example...)
              Thanks for using the LawsonGuru.com forums!
              John
              J.W.
              Basic Member
              Posts: 7
              Basic Member
                My apologies for posting in the wrong forum.

                I will take a look at the files you suggested. Thanks for the heads up.
                You are not authorized to post a reply.