Patrick_Finucane
Patrick_Finucane

Reputation: 755

Netsuite Client Script only Executes in Testing Mode

I have a simple client script that works fine in testing mode. But once I deploy it, it stops executing.

/**
 * @author Patrick 
 * @NApiVersion 2.x 
 * @NScriptType ClientScript
 */
define(['N/ui/message', 'N/record'],
    function(message, record) {

        function pageInit(context) {
            var purchaseOrder = context.currentRecord;
            log.debug(purchaseOrder);

            return true;
        }

        return {
          pageInit: pageInit
        }
    }
);

enter image description here

This deployment works. But once I switch it to deployed it stops working. Any suggestions on what I am missing would be a great help. Thanks.

Upvotes: 3

Views: 675

Answers (1)

bknights
bknights

Reputation: 15462

When you deploy a script you generally need to set the Audience. Otherwise you get what you have just observed.

Upvotes: 7

Related Questions