duplicate check for multiple fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2020 10:37 PM
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
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2020 01:46 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2020 01:58 AM
addQuery() for first field is working when commented others fields and after that it is not working for others.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2020 02:04 AM
addquery() is working only for one field if i commented other fields but when tring for two or three it is not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2020 02:23 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader