Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
By laraujo
#4551
Hello,

I'd like to establish an ID for each case I start in a process.

The thing is... I don't know what to use for an ID. Should I use the Case Code? the PIN? can I create an ID number of my assigned automatically for each case?

also... I need to make this ID visible on a text field in the dynaform.

what do you recommend?

thanks in advance
User avatar
By amosbatto
#4557
The cases auto-increment starting from the number 1. Each case in a process is given a new unique number, so you can use this. This number appears in the case title preceded by a hash sign "#". If you need to access it from a trigger, however, you have to use executeQuery:
$app = @@APPLICATION;
$query=executeQuery("SELECT APP_NUMBER FROM APPLICATION WHERE APP_UID='$app'");
@@CaseNo = $query[1]['APP_NUMBER'];
Then create a DynaForm field named "CaseNo" to display it in a DynaForm.

The PIN number is also unique, so you can use either one. Just depends whether you want people to know how many cases there have been. The PIN is available as a case variable @@PIN. If you name a DynaForm field "PIN", then the PIN will automatically be displayed.
By laraujo
#4585
Thanks a lot, it works fine!

I thought of using the auto.increment number, but I found out the case number is different depending on the task's assigned user.

I decided to use the PIN solution...
If this value is unique, then it works fine.

Thank you very much!!
Have a nice day! :)
By shailoz
#813868
Hi,

I am new to ProcessMaker and suspect that I am making a basic error but I cannot see what it is ...
I tried to do exactly what you suggest but when the Dynaform is displayed the field is blank?
any suggestions as to what I may have missed.

1. I configured the trigger
2. added the step
3. Created dynafom
4. In the "steps" of step I added the trigger before the dynaform
5. I added the dynaform to the "steps"

Thank you in advance.

Shailoz
By shailoz
#813869
I just noticed it worked with @@PIN but does not work with @@APPLICATION - now I am really confused!
User avatar
By amosbatto
#813875
First of all, what version of PM are you using? Those are instructions for PM 1.2 from 2009. They will probably work in PM 2, but not in PM 3.

If using PM 3, create the following string variables named "caseId", "caseNo" and "pin". Then associate those string variable with text fields in a DynaForm. Then create a trigger, with the following content:
Code: Select all
@@caseId = @@APPLICATION; 
@@caseNo = @@APP_NUMBER;
@@pin = @@PIN; 
Set this trigger to execute before your DynaForm containing the text fields.
By shailoz
#813879
Thank you for the response. I already did something similar to your suggestion and in the process found that the "SELECT * from APPLICATIONS ..." should be APPLICATION

Problem solved!

Thanks again

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]