This topic contains 1 reply, has 0 voices, and was last updated by pts.vharbison 6 years, 6 months ago.

  • Author
    Posts
  • #21336 Score: 0

    pts.vharbison
    • Contributions: 0
    • Level 1

    Hi,

    I am having trouble calling a function using the .addButton function in a suitelet.

    I have a tiny snippet here.

    function main(request, response)

    {

    var form = nlapiCreateForm('Purchase Order Confirmation', true);

    form.setScript('customscript336'); //Script id of a client script

    form.addButton('custpage_button','SUBMIT', "talert();"); //talert() contains functions such as nlapiLoad, nlapiSubmit, etc

    //write the form on the reponse of the Suitelet

    response.writePage( form );

    }

    I am using an external URL (Available Without Login). The problem is, I cannot use functions such as nlapiLoad, nlapiSubmitFIeld, etc with the .addButton. However, with the INTERNAL url, everything works fine. Does anyone have an alternative or ran into this problem and can provide a solution with the .addButton dealing with external Urls?
    This is a cached copy. Click here to see the original post.

  • #21337 Score: 0

    pts.vharbison
    • Contributions: 0
    • Level 1

    So after a lot of testing,

    I did not realise I could just simply do the GET and POST requirements concerning External URLs using the .addSubmitButton(label). wooo

You must be logged in to reply to this topic.