1. UE (2.1) script deployed on a Customer Record 2...
# suitescript
j
1. UE (2.1) script deployed on a Customer Record 2. Executing as a
ABC custom role
3. UE Script defines a custom module in my file cabinet
ex. define(['N/record', 'N/runtime', 'N/search', 'N/https', 'SuiteScripts/Mosaic/PLX_CM_Common.js'],
4. In the CM, I have a callback function that creates custom record type I would assume when* the original UE script calls the CM, it would use the same permissions applied to the UE Script? But instead I'm getting a permission error (
ABC Custom Role needs a higher level permission on this custom record type
) I don't get this error when I trigger the UE script in my admin role though.
I've been reading through the docs, and don't see anything that would let me execute the custom module using a specific role.
b
which permission model does the custom record type use
j
Use Permission List > I have a handful of custom roles that have access to this custom record type. Specifically ABC custom role (the role I have defined on the script deployment record) has Full Access.
b
that should probably do it
what does the script deployment look like
j
• The Integration Role has full access to the custom record type i'm trying to create with my custom module
{PLX_CM_Common.js}
Copy code
{
  "type": "error.SuiteScriptError",
  "name": "INSUFFICIENT_PERMISSION",
  "message": "Permission Violation: You need a higher permission for custom record type PLX Failed Sync Logs to access this page. Please contact your account administrator.",
  "stack": [
    "Error\n at suitescript/resources/javascript/record/recordImpl.js:40:12\n at Function.createRecord_raw (suitescript/resources/javascript/record/recordImpl.js:38:24)\n at suitescript/resources/javascript/record/recordImpl.js:26:29\n at Object.createRecord (suitescript/resources/javascript/record/recordImpl.js:24:24)\n at createRecord (/SuiteScripts/Mosaic/PLX_CM_Common.js:501:32)\n at /SuiteScripts/Mosaic/PLX_CM_Common.js:307:21"
  ],
  "cause": {
    "type": "internal error",
    "code": "INSUFFICIENT_PERMISSION",
    "details": "Permission Violation: You need a higher permission for custom record type PLX Failed Sync Logs to access this page. Please contact your account administrator.",
    "userEvent": null,
    "stackTrace": [
      "Error\n at suitescript/resources/javascript/record/recordImpl.js:40:12\n at Function.createRecord_raw (suitescript/resources/javascript/record/recordImpl.js:38:24)\n at suitescript/resources/javascript/record/recordImpl.js:26:29\n at Object.createRecord (suitescript/resources/javascript/record/recordImpl.js:24:24)\n at createRecord (/SuiteScripts/Mosaic/PLX_CM_Common.js:501:32)\n at /SuiteScripts/Mosaic/PLX_CM_Common.js:307:21"
    ],
    "notifyOff": false
  },
  "id": "",
  "notifyOff": false,
  "userFacing": true
}
PLX_CM_Common.js is the CM I'm calling from the UE script
The custom record really isn't that confidential, maybe I should just make it public and call it a day?
b
sounds weird, does it work if you put the code in the actual user event script file