Transform map script to check the active and inactive records

nikhitha24
Tera Guru

Hi All,

 

I have a requirement where the data comes from a third party and we are using webservice and it updates in a custom table.

we are using transform maps to map the data into custom table.

Scenario 1 : I have two records in the custom table with same number (number is the unique value) one is active and other was inactive so if there is any update that was coming through the webservice then it has to check the active record and update it and it should ignore the inactive record,.

Scenario 2 : In custom table there is only one record and it was inactive if there is any update receiving then the system should ignore that update.

 

Can you please help me with this.

Thanks in advance

 

11 REPLIES 11

Community Alums
Not applicable

Hi @nikhitha24 ,

Please try below code may be this will help you 

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

    // Add your code here]
    if(target.active == true && source.number == target.number && target.active == "true"){
		ignore = false;
	}

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

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

Hi @Community Alums 

 

it's not working