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 azalea
#786389
Dear All,

I have a three step process as follows
Step 1 - A user initiates a new case.
Step 2 - A staff member reviews the case and can either make a decision or pass it on to an expert.
Step 3 - Once the decision has been made send an email to the first user.


As the case progresses through the process the various stages the @@FirstUser keeps changing.

On start of a new case I run the following in the start up trigger
Code: Select all
@@FirstUser = @@USER_LOGGED;
@@Data = executeQuery("SELECT APP_NUMBER FROM APPLICATION WHERE APP_UID = '" . @@APPLICATION . "'");
@@CaseNumber = @@Data[1]['APP_NUMBER'];
What am I doing wrong to be able to keep the first users details in the process?

Please help :cry: :cry: :cry:
User avatar
By amosbatto
#786419
Hi Azalea,
As the case progresses through the process the various stages the @@FirstUser keeps changing.
That code example in the wiki is bad, because @@FirstUser will be changed every time the case returns to the first task. I have updated the documentation at http://wiki.processmaker.com/3.0/Tasks# ... Assignment to fix this.

You can use this trigger code to make sure that @@FirstUser is only set once in the case:
Code: Select all
if (!isset(@@FirstUser) or empty(@@FirstUser)) {
   @@FirstUser = @@USER_LOGGED;
   @@Data = executeQuery("SELECT APP_NUMBER FROM APPLICATION WHERE APP_UID = '" . @@APPLICATION . "'");
   @@CaseNumber = @@Data[1]['APP_NUMBER'];
}

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[…]