Transform map should not update if one record is missing value.

suryan
Kilo Expert

In Transform map iam updating the records(no inserting). If ST validation id is empty then that record is not updating, it is working fine. My requirement is if

1)I'am updating 1000 records if 999 records is having ST.validation_ID, then i don't want to update single record in transform map,(the transform map should not be happen for single record out of 1000 i.e if 1 record is missing validation.ID whole 1000 records should not update.) means the transform map option should not complete.

2)I'am getting messages in system log, is it possible to get the message while doing transform map so that user be able to know that records are not updating because of empty validation ID.

1 ACCEPTED SOLUTION

is the source field name is ST.validation_ID. Can we replace the dot after ST with underscore like ST_validation_ID and also in you if condition there is a comma after ST.validation_ID. Can you please remove that and try. Can we something like this with nil() function.



(function transformRow(source,map, log, target) {


  if(action == 'insert'){


        ignore = true;


  }


  if(source.ST_validation_ID.nil()){


            ignore = true;


          error = true;


          var error_message='Supplier Validation Results field is blank, Please update the field to   complete the update';


          log.info(error_message);


  }


})(source, map, log,   target);


View solution in original post

20 REPLIES 20

Hi



if(action=='insert'){


ignore = 'true';


}


if(source.u_supplier_validation_result == ''){


ignore = 'true';


error=true;


error_message='Supplier Validation Results field is blank, Please update the field to   complete the update';


}



this is the code i wrote if validation result is empty it is skipping only dat record, remaining it is updating. I want whole transform map to be aborted.


Can you please remove the quotes from below true keyword, hoping this is onStart() script?


ignore = 'true';


This is my onstart script



(function transformRow(source,map, log, target) {



  if(action == 'insert'){


ignore = true;


  }


  if(source.ST.validation_ID, == ''){


  ignore = true;


  error = true;


  error_message='Supplier Validation Results field is blank, Please update the field to   complete the update';


  }



})(source, map, log,   target);



this wil only the row skip if validation id is empty, it is not aborting the whole insert if any one validation id is empty.


is the source field name is ST.validation_ID. Can we replace the dot after ST with underscore like ST_validation_ID and also in you if condition there is a comma after ST.validation_ID. Can you please remove that and try. Can we something like this with nil() function.



(function transformRow(source,map, log, target) {


  if(action == 'insert'){


        ignore = true;


  }


  if(source.ST_validation_ID.nil()){


            ignore = true;


          error = true;


          var error_message='Supplier Validation Results field is blank, Please update the field to   complete the update';


          log.info(error_message);


  }


})(source, map, log,   target);


Replace the dot after ST with underscore like ST_validation_ID and replace the code like this -> source.ST_validation_ID.nil(),


it is onstart script, still it is not working