Share ideas, ask questions, and get feedback about developing for ProcessMaker

Moderators: ArturoRobles, ArturoRobles

Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
By laraujo

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
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:
@@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
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

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.

By shailoz
I just noticed it worked with @@PIN but does not work with @@APPLICATION - now I am really confused!
User avatar
By amosbatto
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
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

Maybe try increasing your thread stack size? Seems[…]

I use PM 3.4. Android push works while IOS push do[…]

[quote=ziadeh post_id=823031 time=1550759948 user_[…]

I have to support reports in processmaker 3.4. A s[…]