PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 07/28/2015 4:26 PM by  maalimsimo
Pop-up Text Message in AP20.1
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages
maalimsimo
Private
Private
Advanced Member
(66 points)
Advanced Member
Posts:28


Send Message:

--
07/27/2015 4:10 PM

    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
    Private
    Private
    Advanced Member
    (66 points)
    Advanced Member
    Posts:28


    Send Message:

    --
    07/28/2015 4:26 PM
    Never mind. I figured this one out....
    You are not authorized to post a reply.