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

Please validate what is the column name in source table for st validation id, it might be a chance that field (column) name is u_st_validation_id. Please open the table (under system definition -> table) and verify the column name.


correct it is u_st_validation_id, changed and run twice still it is allowing to update if validation id is empty.



checked


1)u_st_validation_id == '' and


2) u_st_validation_id.nill()



still same issue



(function transformRow(source, map, log, target /*undefined onStart*/ ) {


  ignore = true;


if(action == 'insert'){


  ignore = true;


  }



  if(source.u_st_validation_id == ''){


  ignore = true;


  error = true;


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


}




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


just try with below script and see.



(function transformRow(source, map, log, target /*undefined onStart*/ ) {


        if(source.u_st_validation_id.nil())


                  ignore = true;


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


copy paste the code, still it is not working


bernyalvarado
Mega Sage

Hope this helps!