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

Moderators: ArturoRobles, ArturoRobles

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.
#815220
Hello

I am a Beginner here so I ask for your patience.

I need to obtain and save into variables the name of user, username an email in order to show them in my dynaform.
I think this should be made in "Edit" part of the dynaform but I do not have clear how the code should be write to do it.
I am using ProcessMaker 3
Please would you give me some examples?

really thanks
#815223
Create three text fields in your Dynaform which are associated with the variables "username", "name" and "email".

Then, create the following trigger:
Code: Select all
$aUser = userInfo(@@USER_LOGGED);
@@username = $aUser['username'];
@@name = $aUser['firstname'] .' '. $aUser['lastname'];
@@email = $aUser['mail'];
Set this trigger to execute before the Dynaform in the "Steps" of the task.
See: http://wiki.processmaker.com/3.1/Proces ... Info.28.29
#824727
Is there anything special we need to do to get this to work with a Web Entry form? Our users have the ability to login via SSO via SAML and we would like to have their names prepopulate in the forms. I've tried the code above in a trigger before the dynaform and tested it out, but it doesn't seem to work.
#824728
incitegraphics wrote:Is there anything special we need to do to get this to work with a Web Entry form? Our users have the ability to login via SSO via SAML and we would like to have their names prepopulate in the forms. I've tried the code above in a trigger before the dynaform and tested it out, but it doesn't seem to work.
Have you tried using the Single Sign On feature in the Enterprise Edition? If you combine that with the "Require user login" option in the Web Entry properties, then you should be able to obtain the username of the logged-in user.

If you marked the option "Authentication" > "Require User Login" in the Web Entry properties, then you can get the username of the logged-in user with this JavaScript code in the Web Entry's Dynaform and place the username in a textbox whose ID is "loggedUser":
Code: Select all
var loggedUsername = $("#userInformation", top.document).text().match(/\((\w*)\)/)[1];
$("#loggedUser").setValue( loggedUsername );
#827569
I have two different forms. for example in the first form filled out by X with the statement X serving as an examiner. and in the second form is approved by Y, but in the second form there is the name X and the task performed is as an examiner. how do you get the name X in the second form?
thank you

the post is really nice. thanks for posting these.[…]

If you want to keep your existing cases, then you […]

check updated row

i have boolean variable that is can not be change […]

Exclusive Gateway Routing Rule Problem

i have boolean variable that is can not be change […]