• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: assign unique registration id

assign unique registration id 14 years 1 month ago #10014

  • komita
  • komita's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Thank you received: 1
Is there a way to have an entry be assigned a unique id number when it is entered?
The administrator has disabled public write access.

Re:assign unique registration id 14 years 1 month ago #10052

  • bogdanc
  • bogdanc's Avatar
  • OFFLINE
  • Moderator
  • Posts: 669
  • Thank you received: 11
Hello,

You can add the following code in the Default Value of a Hidden Field (named for example "index" ):
//<code> 
return "REGISTRATION NUMBER-".str_pad(intval(@mysql_result(mysql_query("SELECT COUNT(`SubmissionId`) cnt FROM ".$RSadapter->tbl_rsform_submissions." WHERE FormId=1"),0)),3,"0",STR_PAD_LEFT); 
//</code>

Note that you will have change the FormId to the id of your form. Now each submission will be given a registration number equal to their submission number.
The administrator has disabled public write access.

Re:assign unique registration id 14 years 1 month ago #10089

  • komita
  • komita's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Thank you received: 1
well, this did work. but it seemd to only work on a form with autogenerate layout. so I probably need to manually place the hidden field in the layout?

thanks for the information.
Last Edit: 14 years 1 month ago by komita. Reason: found answer
The administrator has disabled public write access.

Re:assign unique registration id 13 years 10 months ago #10768

  • komita
  • komita's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Thank you received: 1
We used this for an event registration and it does work. However, we had many problems with duplicate registration numbers when several computers were being used at the same time. How do we make the number assigned be unique/primary?
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!