Ap20.2 and Imagenow

 5 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
Kate Liamero
Veteran Member
Posts: 70
Veteran Member
    I am creating a custom AP20.2 screen to intergrate with ImageNow's Internet Explorer Learn applet. I want to be able to pull the vendor name from the AP20.2 screen into the Imagenow index. I have no problem with the co#, vendor#, invocie# and invoice date because the learn mode can capture them as id = _f6 customid=text1. Learn mode cannot see the vendor number because it is an out field. The learnmode can only see fields such as id_f9, form#5, TF0-0#6, DTO#28, and it can see text placed on a button. The vendor name on this form is id="out1 and the learn mode cannot see it to use it. I need a function that can either copy the vendor name onto the text of a button that does nothing if you click on it or create a true _f## field that can replace the out field on the form.

    Thanks
    Kate
    All version 9.0
    John Henley
    Posts: 3353
      Hello Kate,
      You've been very quiet...

      Fastest thing to do would be just change the .xml file for AP20.2 so that vendor name is a text field instead of an output only field. You just need to match up the right syntax, and away you go...until you recompile a new AP20.2.xml and you have to re-do it again, and again, etc. Or until your users ask you why when the "change the vendor name", it doesn't really change the vendor name...

      To do it the "correct" way assumes you have Design Studio. (technically you can do this without it, but you wouldn't be able to maintain it...) What I would do is "delete" the existing vendor name field using Design Studio. Then add a text box and bind its data source to vendor name. To prevent users from entering into it, use JavaScript in the OnBeforeTransaction event to set the .style attributes to disabled so that it becomes an output only field, but for the purposes of your ImageNow integration, it's an entry field.

      Keep in mind that as you install CTPs and MSPs, Design Studio forms do require maintenance. It's not a free lunch.
      Thanks for using the LawsonGuru.com forums!
      John
      Kate Liamero
      Veteran Member
      Posts: 70
      Veteran Member
        Thanks John I'll try the delete and add terxt box in design studio
        Kate Liamero
        Veteran Member
        Posts: 70
        Veteran Member
          Ok John. Your suggestion to delete the output vendor name field and add a text box with the vendor name as a datasource worked. Added text 86 and Imagenow learn mode can see it now but being javascript impaired I have no clue on how to prevent entry into this field. Below is the scripting that is already in design studio on the script tab.

          Thanks for you help

          Kate

          function FORM_OnBeforeTransaction(fc)
          {

          var Error="N";

          if (fc != "A" && fc != "C")
          return true;

          for (i=0; i <= 5; i++)
          {
          var Account=lawForm.getFormValue("text72",i);

          if (Account == 16301 ||Account == 16401 || Account == 16501 || Account == 16551 || Account == 16601 || Account == 16701 ||Account == 16801 || Account == 16101 || Account == 16201)
          {
          var Template=lawForm.getFormValue("text84",i);

          if (Template == "")
          {
          lawForm.positionInFieldById("text84",i);
          lawForm.setMessage("Asset Template is Required for Account");
          alert("Asset Template is Required for Account");
          var Error="Y";
          return false;
          }

          var Quantity=lawForm.getFormValue("text85",i);

          if (Quantity == 0)
          {
          lawForm.positionInFieldById("text85",i);
          lawForm.setMessage("Quantity is Required for Asset Template");
          alert("Quantity is Required for Asset Template");
          var Error="Y";
          return false;
          }
          }

          }

          var AuthCode=lawForm.getFormValue("text6");

          if (AuthCode == "")
          {
          lawForm.positionInFieldById("text6");
          lawForm.setMessage("Authority Code is Required");
          alert("Authority Code is Required");
          var Error="Y";
          return false;
          }

          if (Error == "Y")
          return false;

          if (Error == "N")
          return true;

          }

          // following script is to get image from imagenow
          Vendor = ""
          var Invoice = ""
          var row =""


          function grabAllFormValues()
          {


          Company = lawForm.getFormValue("text1", 0);
          if (Company == '')
          {
          alert("Cannot display image without a valid Company value on the form.");
          return;
          }
          Vendor = lawForm.getFormValue("text7", 0)
          if (Vendor == '')
          {
          alert("Cannot display image without a valid vendor value on the form.");
          return;
          }
          while (Vendor.charAt(0)==" ")
          {
          var VendorLength=Vendor.length;
          Vendor = Vendor.slice(1,VendorLength);
          }
          }


          function BUTTON_OnClick(id,row)
          {
          // if button is 'push12', be sure we have an Invoice("text12")
          if (id == "push12")
          {
          Invoice=lawForm.getFormValue("text12");
          if (Invoice == "")
          {
          alert("Please enter a Invoice number");
          lawForm.positionInFieldById("text12");
          return false;
          }
          }
          return true;
          }



          function DisplayImageWeb()
          {
          grabAllFormValues();
          BUTTON_OnClick();
          // alert("Company is " + Company)
          // alert("Vendor Number is " + Vendor)
          // alert("Invoice Number is " + Invoice)
          imgAddress = "http://edison9080/webnow/index.jsp?action=filter";
          // imgAddress = "http://m-imagenow/webnow/index.jsp?action=filter&username=anonymous&password=1";
          //imgAddress = imgAddress + "drawer= AP Primary";
          imgAddress = imgAddress + "&drawer=";
          imgAddress = imgAddress + "&folder=" + Vendor;
          imgAddress = imgAddress + "&tab=" + Invoice;



          imgWindow=window.open(imgAddress,"invoiceWindow","location=yes,menubar=no,resizable=yes,scrollbars=yes,titlebar=yes,toolbar=yes,status=yes");
          imgWindow.focus();
          return true;
          }

          John Henley
          Posts: 3353
            Put this in OnAfterTransaction()
            var txtInvoice = lawForm.getFormElement("text86")
            if (txtInvoice) {
            txtInvoice.disabled = true;
            }
            Thanks for using the LawsonGuru.com forums!
            John
            Kate Liamero
            Veteran Member
            Posts: 70
            Veteran Member
              You did mean to place in FORM_OnBeforeTransaction(fc) not AFTER transaction right?

              Anyway that's where I put it and the Imagenow applet see the name and it works. You're the best

              Thanks

              Kate