This is weird. When, in the UI, I change the value...
# suitescript
c
This is weird. When, in the UI, I change the value of a custom field on a sales order that has no items, lineInit is called before fieldChanged!
b
adding a logging function in client script can be helpful to see how and when the events happen
Copy code
/**
 * @NAPiVersion 2.0
 * @NScriptType ClientScript
 * @NModuleScope Public
 */
define([], function () {
  var entryPoints = [
    "pageInit",
    "saveRecord",
    "validateField",
    "fieldChanged",
    "postSourcing",
    "lineInit",
    "validateLine",
    "validateInsert",
    "validateDelete",
    "sublistChanged",
  ];

  return entryPoints.reduce(function (factoryObject, entryPoint) {
    factoryObject[entryPoint] = function (context) {
      console.debug(entryPoint, context);
      return true;
    };
    return factoryObject;
  }, {});
});
if you are seeing weird behavior, it helps to disable or modify script audiences of other client scripts/workflows to not run