duplicate check for multiple fields

Kajal16
Kilo Contributor

hello 

i want to apply duplicate check for multiple fields in such a way if one field id is same for two fields then it will go for another three field checking and if these fields match then it will pop up a message for user already exist. Here i applied a bussiness rule where it is correctly working for one fields but when i apply code for another fields it takes values in the table with that also shows that invalid insert.Kindly give solution for this.

thanks 

8 REPLIES 8

Hi Kajal,

since both the table and the BR is in same custom scope it should work

Can you try commenting one by one the addQuery() which compares the field; possibly print those before query

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

addQuery() for first field is working when commented others fields and after that it is not working for others.

addquery() is working only for one field if i commented other fields but when tring for two or three it is not working.

Hi Kajal,

Seems weird; can you try to use addEncodedQuery for all the fields and test once

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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