Data Load in Asset table

Sarah Bouil
Tera Expert

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 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. I tried with below code but it is not working.

 

AQCC.png

 

(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;
isValidId = new VFdpdExport().isActiveValidId('u_aqcc', 'u_active=true^u_displayname=' + aqccName);
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);

It is always ignore the record and showing the message as 'Record has not been created due to invalid value in AQCC Name column'. I am suspecting the total AQCC Name consider as a one String(AQCCTest01, AQCCTest02) hence it's ignoring.

8 REPLIES 8

I hope my question is clear, if it's not clear please do let me know. Still my issue is not resolved.

AQCCTest01 is exist so the record should insert in Asset table with AQCC Name(u_aqcc_name) field data. AQCCTest02 is not exist so this need to be ignore it. I am getting below error.

 

AQCCTest01, AQCCTest02 Record has not been created due to invalid value in Business Application Name column"
 
But AQCCTest01  is exist.
AQCCTest02 doesn't exist.
 

But you are passing both value for single row so either that row will be updated or ignored.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Hi Anil,

 

Yes, I need to pass multiple(it may be one or two or three) values in single row.

 

1. The row contains one AQCC Name and if the AQCC  Name is invalid just example: AQCCTest02 then whole record insert or update should be ignored

2. The row contains many AQCC Name, means it's a combination of exist and doesnt exist then record should be create or update with exist AQCC Names and it should be ignore the invalid one's. Because it is creating gost record in u_aqcc table if the AQCC Name doesn't exist.

 

So I need to achieve the above scenario's. Could you help me with the code.