Pop-up Text Message in AP20.1

 1 Replies
 1 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
maalimsimo
Veteran Member
Posts: 49
Veteran Member

    We have custom javascript code in the AP20.1, AP20.2 and AP20.6 forms that alerts the user to ensure that the HOLD_CODE and REMIT_CODE are keyed in for certain AP Companies. This part works well, but somehow the code introduced yet another pop-up window that is not desired and it is unnecessarily increasing key-strokes for the users. It simply says has the text 'EXP', and the 'OK' button. It is not an error message and does not stop the process, but pops up whenever the ADD or CHANGE function is selected. Now, I am not a javascript programmer at all, hence my call for help in suppressing it.

     

    Any help will be greatly appreciated.

     

    Here is the code:

     

    function FORM_OnBeforeTransaction(fc)

    {

                var ap_company = lawForm.getFormValue('text1');

                var continue_add=true

                if((fc=='A'||fc=='C') && (ap_company >1100 && ap_company <1410))

                {

                var vHandlingcode = lawForm.getFormValue('text14');

                           

                //add a dme call to find it this is a matching type invoice

                var s = portalWnd.DMEPath;

                s += "?_PDL="+strPDL;

                s += "&FILE=MAINVHAND&FIELD=MATCH-FL;&SELECT=HANDLING-CODE^%3D"+vHandlingcode

                s += "&XCOLS=TRUE&XKEYS=TRUE&XRELS=TRUE&XCOUNT=TRUE&XIDA=TRUE&OUT=CSV&DELIM=~&NOHEADER"

                var sReturn = " ";

                var objhttp = portalWnd.objFactory.createInstance("http");

                objhttp.Open("GET",s,false);

                objhttp.Send("UserInfo");

                sReturn = objhttp.responseTEXT;

                sDataReturned = sReturn.split("\n");

                           

                /// only if the return from the query = N do we make the hld-code required

                if (sDataReturned[1]=='N'){continue_add=addHLDCODE();}

                //only if the hld-code check passed do we continue

     

                if(continue_add){continue_add=addREMITCODE();}      

                }

                if(continue_add){return true;}

                else      {return false;}

    }

     

     

    function addHLDCODE()

    {         

                var message='You must enter a HOLD CODE';

                var hldcode = lawForm.getFormValue('text43');

                if(hldcode!='')

                {

                return true;

                }

                else

                {

    lawForm.setMessage(message);

    alert(message);

    lawForm.setActiveTab("TF0-3");

    lawForm.positionInField("_f119");

    return false;

                }

    return true;

    }

               

    function addREMITCODE()

    {         

                var message='You must enter a REMIT CODE';

                var remitcode = lawForm.getFormValue('text11');

                if(remitcode!='')

                {

                return true;

                }

                else

                {

    lawForm.setMessage(message);

    alert(message);

    lawForm.setActiveTab("TF0-0");

    lawForm.positionInField("_f28");

    return false;

                }

    return true;

    }

    maalimsimo
    Veteran Member
    Posts: 49
    Veteran Member
      Never mind. I figured this one out....