Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
User avatar
By ariannovin
#824091
Hi
i want to have some general attributes or variables or configurations that in the user's processes i can use them to display data base on them.
for example i have a variable which indicates financial year, by changing the value of this variable by user some dropdowns in processes assigned to this user should be changed respectively.
thousand thanks in advance. :)
User avatar
By amosbatto
#824104
Create a PM Table (or a Table in your external database) which is named USER_OPTIONS and has the following fields:
ID (int, autoincrement, primary key)
USERNAME (varchar)
FIELD1 (varchar)
FIELD2 (varchar)

Add records to the the table that contain th options that you want for each user in FIELD1 and FIELD2.

Then create a Dynaform which has the following fields:
* Textbox with the ID and variable "currentUsername"
* Dropdown with ID "selectField1" which has the following SQL query:
SELECT FIELD1, FIELD1 FROM PMT_USER_OPTIONS WHERE [email protected]@currentUser
* Dropdown with ID "selectField2" which has the following SQL query:
SELECT FIELD2, FIELD2 FROM PMT_USER_OPTIONS WHERE [email protected]@currentUser

Then create the following trigger:
@@currentUsername = @@USR_USERNAME;

Set this trigger to fire before the above Dynaform.

See:
https://wiki.processmaker.com/3.1/Dependent_Fields
https://wiki.processmaker.com/3.2/DynaF ... SQL_Format
User avatar
By ariannovin
#824114
Many thanks for your comprehensive response.
unfortunately using pm table is not an option for me as i want to access it via normal users (they may have not access to that pm tables).
i want to have these configuration some where else which each user can access it and be able to modifies its values.

sorry it didn't get attach first time mysql-erro[…]

Hi guys, Im using process maker 3.3.6-1 community […]

We are using the SAML plugin (see screenshot). Do[…]

Hi, I'm having some issues with the Android app. I[…]