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

Jitendra Diwak1
Kilo Sage

Hi @nikhitha24,

 

You can write onbefore script in transform and check if number and active field is matched then update it.

 

Thanks

jitendra

Please accept my solution if it works for and thumps up.

Hi Jitendra,

 

i have tried it with below but its not working , is something that i'm checking wrong here

if(source.u_number == target.number && target.active == true && action == 'update'){
ignore = false
}

 
Please try this below code:
 if(source.u_number == target.number && source.u_active == target.active && action == 'update'){
ignore = false
}
 
Thanks
Jitendra
Please accept my solution if it works for and thumps up.

Hi Jitendra,

 

we are not receiving any active flag from source.

so i'm not sure if we can user the source.u_active
it's just we need to check the active inactive at target level