Custom button run using Client and userEvent Script, this code not Runnig, Error occurs: function buttonClick not defined

/**
 * @NApiVersion 2.0
 * @NScriptType UserEventScript
 */
define([“N/ui/serverWidget”], function (serverWidget) {
  // function showPassedValueFunc() {
  //   empId = empId;
  // }
  // function beforeLoad(context) {}
  // function afterSubmit(context) {}
  return {
    beforeLoad: function (context) {
      var form = context.form;
      form.addButton({
        id: “custpage_dsc_emp_history”,
        label: “History”,
        functionName: “buttonClick”,
      });
    },
    //showPassedValueFunc: showPassedValueFunc,
  };
});
/**
 * @NApiVersion 2.0
 * @NScriptType ClientScript
 */
define([], function () {
  return {
    buttonClick: function (context) {
      var employee = context.currentRecord;
      alert(“This is employee Data”, employee);
    },
    pageInit: function (context) {},
  };
});
Rookie Asked on April 8, 2022 in SuiteScript.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor   Become a Sponsor