Send data to another server

Sort:
You are not authorized to post a reply.
Author
Messages
wilcoxmad
Veteran Member
Posts: 87
Veteran Member

     

    function callMEMB()
    {
         var s = "http://myserver:80/gscmembership/hr/lawson.svc/update?"
         s += "ClockId=" + lawForm.getFormValue("text2");
         s += "%%Division=" + lawForm.getFormValue("text168");
         s += "%%Department=" + lawForm.getFormValue("text169");
         s += "%%HireDate=" + lawForm.getFormValue("text186");
         s += "%%LastName=" + lawForm.getFormValue("text165");
         s += "%%FirstName=" + lawForm.getFormValue("text166");
         s += "%%MiddleName=" + lawForm.getFormValue("text167");
         s += "%%NickName=" + lawForm.getFormValue("text226");
         s += "%%TermDate=";
     
         s = s.replace('&','%26');
         s = s.replace(/%%/g,'&');
     
         //Send URL to the server
     
    //This one returns a security error
         portalWnd.httpRequest(s);
     
    //This one works but leaves a blank IE window open
         window.open(s);
    }

    What am I doing wrong? The first send gets a security error and does not update the other server. The second send leaves a blank window open but works.

     

    Gary Davies
    Veteran Member
    Posts: 248
    Veteran Member
      I dont know why you are fussing with %% and changing it back to &. Just use the & as such
      s += "&Division=" + escape(lawForm.getFormValue("text2"));

      The server you are calling, does it require authentication? is it not the Lawson server, is it 9.0 and is the other server included in the SSO.

      The second is going to do that exactly, it will pop open a new window an attempt the call, if the servier that is being called does not return a response it would be blank.
      I would not use the window.open unless you want the results to stay open. You probably can trick it by assigning the open

      var TheWindow = window.open(s);
      TheWindow.close();

      But I would not recommend this.
      wilcoxmad
      Veteran Member
      Posts: 87
      Veteran Member
        Posted By Gary Davies on 11/25/2009 10:19 AM
        I dont know why you are fussing with %% and changing it back to &. Just use the & as such
        s += "&Division=" + escape(lawForm.getFormValue("text2"));

        The server you are calling, does it require authentication? is it not the Lawson server, is it 9.0 and is the other server included in the SSO.

        The second is going to do that exactly, it will pop open a new window an attempt the call, if the servier that is being called does not return a response it would be blank.
        I would not use the window.open unless you want the results to stay open. You probably can trick it by assigning the open

        var TheWindow = window.open(s);
        TheWindow.close();

        But I would not recommend this.


        The server you are calling, does it require authentication? - NO.

        is it not the Lawson server,- NO. 

        is the other server included in the SSO - NO.

        It is just a web service on another server that keeps data in sync between the two.

        Thanks for the "escape" tip.

        Robert
        Veteran Member
        Posts: 82
        Veteran Member

          I believe your first example fails because your are submitting an http request through a Portal object and that won't work.

          Have you returned the URL in either a print statement or prompt box so you can capture and test it?

          Did you try  window.location.href?

           

          function LoadSite() { 

            var url = "http://www.google.com";

            window.location.href=url;

          }

           

           

          You are not authorized to post a reply.