Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount! Get 20% off now with code SPOOKY-2024!

Increment auto numbering

  • cardoso69
  • cardoso69
  • OFFLINE
  • Posts: 27
  • Thanks: 1
  • Karma: 0
  • Add-ons
11 years 9 months ago #219914 by cardoso69
Replied by cardoso69 on topic Increment auto numbering
ok, not lucky... :(

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 9 months ago - 11 years 9 months ago #219944 by krileon
Replied by krileon on topic Increment auto numbering
Below is a simple usage of a single CB integer field that increments. Note it does not have the complex conditions of groups that you are wanting, you must add that your self.

First you need to setup the integer field. Lets call it cb_autoinc as this will be its database column and be used throughout this usage.

Next you need to create a CB Query field (we'll call it cb_queryinc) that will pull from _comprofiler the highest value and increment it by 1. We can do this with the below query.
Code:
SELECT ( `cb_autoinc` + 1 ) FROM `#__comprofiler` ORDER BY `cb_autoinc` DESC LIMIT 1

Now you'll need a field action using CB Auto Actions with the after registration trigger. You'll configure it to set cb_autoinc to the following value (a substitution of the query field).

[cb:userfield field="cb_autoinc" /]

Now everytime a user registers it should find the highest value of the increment field, add 1, then set the field for them as that incremented value.


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.
Last edit: 11 years 9 months ago by krileon.
The following user(s) said Thank You: enetanswers

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

  • cardoso69
  • cardoso69
  • OFFLINE
  • Posts: 27
  • Thanks: 1
  • Karma: 0
  • Add-ons
11 years 8 months ago #219999 by cardoso69
Replied by cardoso69 on topic Increment auto numbering
Dear krileon.
I'll try it and come tou you with the results.
Thank's for the idea.

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

Moderators: beatnantkrileon
Powered by Kunena Forum