Bill He
01/31/2023, 5:07 AMlet recordInstance = record.load({
type: "customer",
id: result.id,
});
But I’m getting a type record mismatch error: "type":"error.SuiteScriptError","name":"SSS_RECORD_TYPE_MISMATCH","message":"The record you are attempting to load has a different type: job from the type specified: customer."
Any idea what I might be doing wrong?Shawn Talbert
01/31/2023, 5:36 AMresult.id
is not the internal id of a customer. i.e. most likely it's exactly what that error message fairly clearly states.Bill He
01/31/2023, 8:02 AMresult.id
from search.create
let recordSearch = search.create({
type: "customer",
});
let records = [];
let dataPages = recordSearch.runPaged({ pageSize: 1000 });
let pageData = dataPages.fetch(0);
pageData.data.forEach(function (result) {
let recordInstance = record.load({
type: "customer",
id: result.id,
});
records.push(getRecordData(recordInstance));
});
NickSuite
01/31/2023, 8:19 AMBill He
01/31/2023, 8:24 AM