Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
remove beforeLoad trigger on nlapiLoadRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljoppi committed Jan 8, 2016
1 parent 63af4e2 commit 0978798
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
3 changes: 0 additions & 3 deletions lib/nsfunc/record-api/load-record.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ exports.nlapiLoadRecord = (type, id, initializeValues) => {
value = actual[field];
record.setFieldValue(field, value);
}

// User Event: "beforeLoad"
$events.runTriggerUserEvent(type, 'beforeLoad', 'view', records);
}

let o = new nlobjRecord(type, id, _uuid),
Expand Down
17 changes: 1 addition & 16 deletions test/_input-files/scripts/fake-user-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,7 @@ var FakeUserEvent = {
beforeLoad: function (type) {
'use strict';

var param = this.context.getSetting('SCRIPT', 'fake-param');
this.context.setSessionObject('before-load-type', type);
this.context.setSessionObject('before-load-param', param);

let recordOld = nlapiGetOldRecord(),
recordNew = nlapiGetNewRecord(),
recordId = nlapiGetRecordId(),
recordType = nlapiGetRecordType();

var field = this.context.getSetting('SCRIPT', 'field-param');
if (recordOld) {
this.context.setSessionObject('before-load-old-code', recordOld.getFieldValue(field));
}
this.context.setSessionObject('before-load-new-code', recordNew.getFieldValue(field));
this.context.setSessionObject('before-load-rec-id', recordId);
this.context.setSessionObject('before-load-rec-type', recordType);
return type;
},
beforeSubmit: function (type) {
'use strict';
Expand Down
15 changes: 0 additions & 15 deletions test/create-user-event-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,6 @@ describe('<Unit Test - Netsuite Create User Event>', function () {
let context = ctx.nlapiGetContext();
should(context).be.ok();

let beforeLoadType = context.getSessionObject('before-load-type'),
beforeLoadParam = context.getSessionObject('before-load-param');
should(beforeLoadType).be.equal('view');
should(beforeLoadParam).be.equal('23');

let beforeLoadOldCode = context.getSessionObject('before-load-old-code'),
beforeLoadNewCode = context.getSessionObject('before-load-new-code'),
beforeLoadRecId = context.getSessionObject('before-load-rec-id'),
beforeLoadRecType = context.getSessionObject('before-load-rec-type');

should(beforeLoadOldCode).be.equal('219');
should(beforeLoadNewCode).be.equal('219');
should(beforeLoadRecId).be.equal('219');
should(beforeLoadRecType).be.equal('customrecord_codeg_ids');

let beforeSubmitType = context.getSessionObject('before-submit-type'),
beforeSubmitParam = context.getSessionObject('before-submit-param');
should(beforeSubmitType).be.equal('edit');
Expand Down

0 comments on commit 0978798

Please sign in to comment.