Hello, how would you load customer IBAN informatio...
# suitescript
j
Hello, how would you load customer IBAN information via suitescript? I tried but it was not working. ID is id of bank entity record (not customer ID). Ideally I would put customer ID and it would find it but is that possible?
Copy code
const bankDetails = record.load({
                type: 'customrecord_2663_entity_bank_details',
                id: '1604',
                isDynamic: true
            });
Also tried search but result is empty.
Copy code
const bankDetailsSearch = s.lookupFields({
                type: 'customrecord_2663_entity_bank_details',
                id: '1604',
                columns: [
                    'name',
                    'custrecord_2663_entity_iban'
                ]
            });
Anyone would have idea why please?
g
What error you are getting?
j
when trying to load the record I got this
Copy code
{
  "type": "error.SuiteScriptError",
  "name": "RCRD_DSNT_EXIST",
  "message": "That record does not exist.",
  "id": "1604",
  "stack": [
    "Error\n at suitescript/resources/javascript/record/recordImpl.js:96:12\n at Function.loadRecord_raw (suitescript/resources/javascript/record/recordImpl.js:94:24)\n at suitescript/resources/javascript/record/recordImpl.js:82:27\n at Object.loadRecord (suitescript/resources/javascript/record/recordImpl.js:80:24)\n at Object.beforeLoad (/SuiteScripts/EITUM/Testing/eitum_jan_ue_test.js:43:40)"
  ],
  "cause": {
    "type": "internal error",
    "code": "RCRD_DSNT_EXIST",
    "details": "That record does not exist.",
    "userEvent": null,
    "stackTrace": [
      "Error\n at suitescript/resources/javascript/record/recordImpl.js:96:12\n at Function.loadRecord_raw (suitescript/resources/javascript/record/recordImpl.js:94:24)\n at suitescript/resources/javascript/record/recordImpl.js:82:27\n at Object.loadRecord (suitescript/resources/javascript/record/recordImpl.js:80:24)\n at Object.beforeLoad (/SuiteScripts/EITUM/Testing/eitum_jan_ue_test.js:43:40)"
    ],
    "notifyOff": false
  },
  "notifyOff": false,
  "userFacing": true
}
g
could you please try passing internal id as number instead of string
Like this
Copy code
const bankDetails = record.load({
                type: 'customrecord_2663_entity_bank_details',
                id: 1604,
                isDynamic: true
            });
j
Unfortunately same thing 😔
g
Are you sure this record with internal id 1604 exists?
j
It was it! Made mistake and it was 1640 instead of 1604... omg. Sorry for taking your time with this 🙏
g
No problem, It happens😄