Create a COUNTER field with auto increment based on another field value

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Create a COUNTER field with auto increment based on another field value

nikonaum
I'm a knew user to orbeon and I'm trying to create a form with a counter
field base on the value of the previous field.
Can someone guide me to a code snippet and give me some basic advice.
Currently I'm using latest Orbeon PE addition with temporary 3 months
license which ends at the end of the month.
So the basic sketch of what I'm trying to do is:
Control field name: document-type
Control field name: counter

If "document-type" begins with "A" "counter"= previous A type document
counter value + 1

If setup a MySQL persistent connection and can create a trigger based tables
fine.

Thank you very much!
 

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1566197210172-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Create a COUNTER field with auto increment based on another field value

Alessandro  Vernet
Administrator
Hi,

When you're saying that you'd like the value to be set to the "value of the
previous field" + 1, what do you mean by "previous field"? Do you have a
repeated section or repeated table, or is there just 1 such field in your
form and you'd like the number to be set automatically every time someone
fills a new form so the number is different each time?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1566339027933-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Create a COUNTER field with auto increment based on another field value

nikonaum
I want the number in the field to be incremented every time someone
fills a new form.

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1566537691772-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Create a COUNTER field with auto increment based on another field value

Alessandro  Vernet
Administrator
Got it. You can do this by creating a table to keep track of that sequence
number in MySQL, and using services and actions to update and read that
sequence number from your form. We have more information on how to do this
with MySQL on the page linked below, and can also envision some "native"
support for this feature in the product so doing this would be more
straightforward.

https://github.com/orbeon/orbeon-forms/issues/4162

You'll let me know if this works for you,

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1566582060799-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Create a COUNTER field with auto increment based on another field value

Alessandro  Vernet
Administrator
Did you get a chance to try the technique described in the RFE to create an
auto-incremented field? If so, did it work for you?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1567181621342-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet