Netsuite.cru | |work|
The Cru.cifixion of SuiteCloud
I’ll provide a NetSuite User Event Script that: netsuite.cru
Frequently Asked Questions
The Power of NetSuite: Unlocking Business Potential with .cru The Cru
// UPDATE if (type === context.UserEventType.EDIT) var oldValue = oldRecord.getValue('custbody_monitored_field'); var newValue = newRecord.getValue('custbody_monitored_field'); if (oldValue !== newValue) log.audit('Field Changed', 'Monitored field changed from ' + oldValue + ' to ' + newValue); // Optional: prevent update under condition if (newValue === 'BLOCKED') throw new Error('Update blocked: custbody_monitored_field cannot be BLOCKED.'); if (type === context.UserEventType.CREATE) log.audit('CRU Feature', 'Record created: ' + recordId); // Create a custom audit record try var auditRec = record.create( type: 'customrecord_cru_audit', isDynamic: true ); auditRec.setValue('custrecord_affected_record', recordId); auditRec.setValue('custrecord_operation', 'CREATE'); auditRec.setValue('custrecord_performed_by', runtime.getCurrentUser().id); auditRec.setValue('custrecord_timestamp', new Date()); auditRec.save(); catch(e) log.error('Audit Creation Failed', e.message);Deployment Instructions
- Save as
cruFeatureUE.js - Create Script in NetSuite:
require 'netsuite/cru'