Ignore the record update if the invalid data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 09:04 AM
I have a AQCC Name(u_aqcc_name) List type field(it reference to u_aqcc table) in Asset table and it holds one or more AQCC Names data with comma(,) separated. if I load data into Asset table thru Transform Maps, if the AQCC Name exist(ex: AQCCTest01) it should be updated and if the AQCC Name(ex: AQCCTest02) does not exist it should be ignore to update in the same record. I tried with below code but it is not working.
function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
var isValidId = true;
var isMandatory = false;
if (!source.u_imp_aqcc_name.nil()) {
isMandatory = true;
}
if (isMandatory == false) {
if (source.u_imp_aqcc_name.nil()) {
ignore = true;
status_message = "Record has not been created due to blank value in AQCC Name column";
}
}
if (isMandatory == true) {
var aqccName= source.u_imp_aqcc_name.split(',');
for (var i=0; i<aqccName.length;i++){
isValidId = new VFdpdExport().isActiveValidId('u_aqcc', 'u_active=true^u_displayname=' + aqccName[i].trim());
}
if (isValidId == false) {
ignore = true;
status_message = aqccName + " Record has not been created due to invalid value in AQCC Name column";
}
}
})(source, map, log, target);
I am getting error AQCCTest01, AQCCTest02 Record has not been created due to invalid value in AQCC Name column. But the AQCCTest01 record is exist in u_aqcc table.