PO 20 need an alert box

 0 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
Kate Liamero
Veteran Member
Posts: 70
Veteran Member

    We would like to do is have an alert popup in PO20 when a user tries to release a po where the PO header ship to is different from the PO Header Process Level.  Not a hard stop just a popup box saying Hey these are different are you sure this is what you want.  We already have the following script on the PO20
    to check that if the accounting units fall between a range then an asset template is required but I believe this one is a hard stop.  I just want an alert box not a stop. 

    Any and all help welcomed.  Thanks Kate

    function FORM_OnBeforeTransaction(fc)
    {
     if (fc != "A" && fc != "C")
      return true;
     
     var Error="N";
     
     for (i=0; i <= 5; i++)
     { 
      var Account=lawForm.getFormValue("text20",i);
      
      if (Account < 16000 || Account > 16999)
      {
       return true;
      }
      
      if (Account >= 16000 || Account <= 16999)
      {
       var Template=lawForm.getFormValue("text27",i);

       if (Template == "")
       {
        /* lawForm.setActiveTab("TF0-1"); */
        lawForm.positionInFieldById("text27",i);
        lawForm.setMessage("Asset Template is Required for Account");
        alert("Asset Template is Required for Account");
        var Error="Y";
        return false;
       }
       if (Error == "N")
        return true;
      }
      if (Error == "N")
       return true;
     }
     if (Error == "N")
      return true;
    }