mg2017
05/02/2023, 11:24 PMif (ss_row_count.count > 0) {
var ss_internal_id;
var profile_collection = [];
ss_row_count.pageRanges.forEach(function (pageRange) {
const data_page = ss_row_count.fetch({
index: pageRange.index
});
data_page.data.forEach(function (result) {
ss_internal_id = result.getValue({
name: 'internalid',
summary: 'GROUP'
});
const ss_cus_profile = result.getText({
name: 'custrecord_profile',
join: 'CUSTRECORD_LOCATION',
summary: 'GROUP'
});
if (ss_cus_profile) {
profile_collection.push(ss_cus_profile);
return true;
}
}
);
});
setProfile(record, ss_internal_id, profile_collection);
}
mg2017
05/02/2023, 11:25 PMbattk
05/03/2023, 2:30 AMNElliott
05/03/2023, 8:04 AMNElliott
05/03/2023, 8:07 AMmg2017
05/03/2023, 8:22 AMfunction setProfile(record, comments, ss_internal_id, profile_collection) {
if (comments != profile_collection) {
log.debug("UPDATE");
const CUSTOMER_RECORD = record.submitFields({
type: record.Type.CUSTOMER,
id: ss_internal_id,
values: {
'comments': profile_collection
}
});
log.debug({title: "Customer Record", details: CUSTOMER_RECORD});
}
return true;
}
mg2017
05/03/2023, 8:27 AMNElliott
05/03/2023, 9:04 AMmg2017
05/03/2023, 9:05 AMNElliott
05/03/2023, 9:05 AMmg2017
05/03/2023, 9:06 AMmg2017
05/03/2023, 9:06 AMNElliott
05/03/2023, 9:07 AMbattk
05/03/2023, 9:28 AMbattk
05/03/2023, 9:28 AMmg2017
05/03/2023, 10:55 AM