@@ -61,7 +61,11 @@ function csExampleModule_CS(log, aModule, bModule) {
6161 log . debug ( { title : `Vendor Prefix Set` , details : { VendorPrefix } } ) ;
6262 if ( ! scriptContext . hasOwnProperty ( 'currentRecord' ) )
6363 throw 'MISSING_RECORD_PROPERTY' ;
64- bModule . set_CustomFieldValue ( scriptContext . currentRecord , VendorPrefix ) ;
64+ bModule . set_CustomFieldValue ( {
65+ currentRecord : scriptContext . currentRecord ,
66+ fieldId : 'custbody_example-id-1' ,
67+ value : VendorPrefix ,
68+ } ) ;
6569 log . audit ( `Vendor prefix saved` ) ;
6670 } catch ( err ) {
6771 log . error ( { title : 'csExampleModule_CS.pageInit()' , details : err } ) ;
@@ -72,6 +76,7 @@ function csExampleModule_CS(log, aModule, bModule) {
7276 * @memberof module:csExampleModule_CS
7377 * @function
7478 * @param {Object } scriptContext -- Passed parameter for NetSuite CS saveRecord entry function
79+ * @param {Object } scriptContext.currentRecord -- Current record being saved
7580 * @description Entry method for CS saveRecord function
7681 * @return {boolean } - Returns `false` if record should not save yet
7782 */
@@ -80,7 +85,7 @@ function csExampleModule_CS(log, aModule, bModule) {
8085 try {
8186 log . audit ( 'starting custom client script saveRecord' ) ;
8287 // Run code to see if...
83- // allowSave = false;
88+ if ( ! scriptContext . currentRecord ) allowSave = false ; //?
8489 } catch ( err ) {
8590 log . error ( { title : 'csExampleModule_CS.saveRecord()' , details : err } ) ;
8691 }
0 commit comments