Hi All, I have a custom form field applied to Sale...
# suitescript
s
Hi All, I have a custom form field applied to Sales Order through the script in BeforeLoad. I'm trying to do specific calculations on the transaction weight and trying to set the values into the custom form field in BeforeSubmit. But I see, the field is empty once the record is saved. Is this supported by NS ? plz help on the same. Code Snippet :
Copy code
function beforeLoad(context)
  {
      var formObj = context.form;
      var field = formObj.addField({
      id : 'custpage_so_test',
      type : serverWidget.FieldType.CURRENCY,
      label : 'SO Calc'
      });
  }
function beforeSubmit(context)
  {
      var soRec = context.newRecord;
      var soCalc= 5+10;
        soRec.setValue({fieldId:'custpage_so_test',value:soCalc});

  }
n
Fields added in beforeSubmit are not stored on the record.