Hi, We have a script to insert Opportunities, for ...
# suitescript
i
Hi, We have a script to insert Opportunities, for a few cases we get this error:
Copy code
MODULE_DOES_NOT_EXIST 
error.SuiteScriptError
Module does not exist: /NLRecordScripting.scriptInit$sys.js
Change_form_due_to_entity_changecode: '',
The code is pretty straightforward:
Copy code
var rec = record.create({
      type: context.recordtype
    });
    setFields(rec, context, ["recordtyle", "sublists", "id"]);
    setLists(rec, context);
    var recordId = rec.save();
    return String(recordId);
All customers use the same forms for Opportunities and for customers. But this seems to be related to Customer record from subsidiaries. Has anyone experienced something similar? Any clue what this error means?
r
What is the script type of the one that creates the Opportunities. If it is a Map Reduce, Scheduled or Suitelet the error might be coming from a User Event script that is deployed on the Opportunity record. The script types I mentioned, will trigger a User Event script.
i
Hi @rustyshackles It's a Restlet. It's a modified version of a script to expose REST methods.
r
Yeah, RESTlets can trigger any UE scripts deployed to the record when you save it. I would check if the error is coming from any UE scripts