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

Can we change the field name in lower case and try, like: st_validation_id


changed to lower case same issue


Yeap ignore = true in the onStart script will halt all the transformation process.



Thanks,


Berny


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 will only   skip the row if validation id is empty on that row, it is not aborting the whole insert if any one validation id is empty.


Below is my onstart transform script. still it is not aborting the action if one row(st validation id) is empty.



(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);