09-01-2016, 01:42 PM
Duplicate Check for any field
|
09-02-2016, 07:35 AM
No it isn't. It is for VT6, the validation code is very lacking and coreBOS has it's own system for validating records.
This is really easy to do in coreBOS, even to do it generically for all modules, I haven't had time to document the validation system but if you look at the modules/Accounts/AccountsValidation.php script you will see this exact example against the accountname. You can copy that script to any module, change the module name and adapt the query. Once I document it I will share the link here.
Joe
TSolucio
09-02-2016, 12:42 PM
I need the following
Create a custom field with an ID (unique number for payment of taxes of Brazilian companies) If the account name (default) or this number already exists, give the standard treatment, or display duplicate the lead conversion, or add the contact to existing account. Only I need, is, add a CF, in the standard treatment today is already coreBOS. In script is only a treatment for default system fields, right?
09-02-2016, 01:50 PM
Sorry, but I am not quite following you. These validation (currently) are only for form/field editing, not for actions (like lead conversion).
You can check for "anything" in the validation scripts, you could even go out to other systems if you needed to. Please try to explain again if you can.
Joe
TSolucio
09-02-2016, 01:55 PM
Ok, I got it.
What I need is right on lead conversion, add a custom field validation. That is, if the account name or this field already exist the error "Account already exists ...
Understood now.
Thats code is for button save right? There is two situations One for lead convertion and another for save account. And for second case, button save, how I can change SQL command to get a custom field, too ?
09-04-2016, 08:52 PM
The easiest way to do that is using QueryGenerator:
PHP Code: $queryGenerator = new QueryGenerator('Accounts', $current_user); Look at our unit tests for a lot of examples: https://github.com/tsolucio/coreBOSTests...orTest.php
Joe
TSolucio |
« Next Oldest | Next Newest »
|
Users browsing this thread: 1 Guest(s)