In Data Load, Ignore the record update if the invalid data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2023 03:04 PM
I have a field AQCC Name(u_aqcc_name) and the type of field is List type field(it's reference to 'u_aqcc' table) in Asset table and also the field AQCC Name(u_aqcc_name) will holds one or more AQCC Names data with comma(,) separated(like AQCCTest01, AQCCTest02).
If I load data into Asset table thru Transform Maps, if the AQCC Name exist(ex: AQCCTest01, loading thru excel file) in 'u_aqcc' table so the data(AQCCTest01) should be updated in AQCC Name(u_aqcc_name) field in Asset table .
If the AQCC Name(ex: AQCCTest02) does not exist in 'u_aqcc' table so 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 valid and it's exist in 'u_aqcc' table. Kindly help what is wrong in my code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 07:29 AM
Hi,
I think your design may be flawed. It seems to me that the logic you have will identify if the source row should be imported or not based on the existance of multiple target records matching the AQCC Name. Is that really what you want or are you trying to update multiple target records using the same source row?
Regards,
Niklas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2023 07:57 AM
Hi Niklas, My requirement is, I need to allow to create or update a whole record with the existing AQCC Names(for example AQCCTest01 is exist so it should be update in AQCC Name field). If any data doesn't not exist like AQCCTest02 so should not update in AQCC Name. If we allow to update in AQCC Name that doesn't exist it is creating a ghost record in u_aqcc table.