Skip to Content Skip to Menu

Unique user document

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
5 months 3 weeks ago #338203 by krileon
Replied by krileon on topic Unique user document
Ok, then yes that's very doable. All you'll need to do is create the field to contain that value. So for example a Text fieldtype. Next you'll need CB Query Field plugin, which will provide the Query Validation functionality in order to validate the field against existing database values. So for example the below should work.

Title: Identification ID
Name: cb_identification
Type: Text
Required: Yes
Integrations > CB Query Field > Validation
Query Validation: Enable
Query:
Code:
SELECT `id` FROM `#__comprofiler` WHERE `id` != '[user_id]' AND `cb_identification` = '[value]'
Validate On: Empty Results
Ajax Validation: Enable

This should take the value they input during registration or profile edit and compare it to the field value of other existing users. If a result is returned from the query it will fail the fields validation. You may also want to use the below to restrict the field to alphanumeric characters only depending on what characters can existing in your ids.

Parameters > Validation
Validation Rule: Custom REGEXP Validation
Custom REGEXP Validation: /^[a-zA-Z0-9]$/


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

5 months 3 weeks ago #338206 by soportemarketing
Replied by soportemarketing on topic Unique user document
Great!

Thank you very much.
Best regards.
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

5 months 3 weeks ago #338211 by soportemarketing
Replied by soportemarketing on topic Unique user document
Hi, Kyle:

I used the query you suggested and works fine, but I already had another query in CB Query Fields for the field that validates the letter the code contains. Is it possible to set a second query for a second validation? Where should I place it?

Thank you very much.
Best regards.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
5 months 3 weeks ago #338212 by krileon
Replied by krileon on topic Unique user document
It's not possible to have 2 separate query validations. You'd need to combine the two queries somehow if possible.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

5 months 3 weeks ago #338213 by soportemarketing
Replied by soportemarketing on topic Unique user document
Hi, Kyle:

ok, we'll try to combine both conditions using PHP via CB Code Field.

Thank you very much.
Best regards.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum