Add a Business Process or Rule that prevents duplicates of in one field on contacts

Hi-

I have a text field that contains a unique number in contacts- and I have a problem where we should only have that number once in our system. I need to prevent my users from creating duplicates when they save new contacts. 

Can I do that in a business rule?

Or what would that look like in a business process?

Like 0

Like

3 comments

In a process, it's really too late for validation. The best way is to accomplish this via programming. You can use the asyncValidate method for this type of task. I have an article here that shows how to use it and even uses a sample scenario that is similar to yours (the sample code in the article shows how to ensure that an opportunity has a unique job number).

https://customerfx.com/article/asynchonous-validation-on-pages-in-creatio-formerly-bpmonline/

You should be able to use the code in the article with minimal changes to accomplish what you're after.

Ryan

Thank Ryan- And I would just paste this into my source code in contacts? Does it matter where in the code I paste it? I can see where I would put in my own info and sub in my object names- but as a non-coder, I want to make sure I add the code in the correct location. 

Heather Mahley,

This would go into the methods block in the page code. Since you're not familiar with writing code, I'd copy and save all the page code first to revert back to if needed. Also, feel free to post the code with the addition here before saving it and I'll take a look to make sure its all in the right place.

Ryan

Show all comments