when record is importing i want to set error message for refernce field those have no matching value

Jyoti Ranjan Se
Tera Contributor

i want to write a transform map script to show an error message when mapped a reference field value not in target table reference field.How to write can you please help me on this.

 

 

Thanks 

Jyoti

1 ACCEPTED SOLUTION

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Jyoti Ranjan Se 

 

Please try to google it the baseline code and give a try.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Jyoti Ranjan Se 

you should use onBefore transform script for this

1) get the source value, query target field's reference table and search if record is present or not

2) if not then use this to add error message

log.info("This is an information message"); 
log.warn("This is a warning message");
log.error("This is an error message");

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

can you please provide the complete script and process

 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Jyoti Ranjan Se 

 

Please try to google it the baseline code and give a try.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************