netsuiteamazon-mwspii

Netsuite : personal information (PI) removal


We have an Amazon MWS API connector that imports data into Netsuite (NS) for shipping and order creation. It is obvious that Amazon data includes PII (Personal Identifiable Information. Amazon policy). Amazon requests that PII never be recorded in logs (in case of NS in system notes). When an order is created trough a script, NS always places in the system notes the billing and shipping addresses. I know NS has 'personal information (PI) removal' but this process is manual. we can manually request to process 100 of orders daily.

have you any idea how to remove PI from NS automatically? And stop recording PII logs. Thx.


Solution

  • I'm not sure when the NS added the N/piremoval module. We fund it after we payed NS to have a premium support <:). Magically appeared. I'll just post the raw code provided by NS.

    /**
     * @NApiVersion 2.x
     */
    
    require(['N/piremoval'], function(piremoval) {
        function removePersonalInformation() {
            var piRemovalTask = piremoval.createTask({
                recordType: 'customer',
                recordIds: [11, 19],
                fieldIds: ['comments', 'phone'],
                workflowIds: [1],
                historyOnly: false,
                historyReplacement: 'removed_value'
            });
            
            piRemovalTask.save();
            var taskId = piRemovalTask.id;
    
            var piRemovalTaskInProgress = piremoval.loadTask({ id : taskId });
            piRemovalTaskInProgress.run();
    
            var status = piremoval.getTaskStatus({ id : taskId });
        };
    
        removePersonalInformation();
    });