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 AxelvH
#786175
Hello, my problem is simple but i cant figgure out how to do it. So basicly all i want to do is to see if a checkbox has been checked after someone have pressed submit. I've put a trigger at "After Dynaform" and it workes, but it will never return the correct answer between true and false.

This is currently how my trigger looks.
DocDone being the boolean that i use for the checkbox.

if(@=DocDone==TRUE)
{
G::SendMessageText("true", "WARNING");

}else{G::SendMessageText("false", "WARNING");}

And it will always print the message of "true" wheter or not the checkbox is checked or not.
I've tried with

@@DocDone==TRUE
@%DocDone== 1
@@DocDone== "1"

But they all yeild the same result or none at all.

Thanks

Axel Hansson
By shuqierduo
#790183
Hi, I have followed the sample code but it does not work i.e. no matter the checkbox is checked or not, it prompts "INFO:FALSE"

The variable "checkboxVar001" is defined as boolean with the labels defined as "true" and "false". Any clue?

if (!isset(@@checkboxVar001) or @@checkboxVar001== "On") {
G::SendMessageText("TRUE", "INFO");
} else {
G::SendMessageText("FALSE", "INFO");
}
User avatar
By amosbatto
#790191
Are you using a BPMN process from version 3 or a classic process from version 2?
Your code is for a classic process and it assumes that you have not changed the value of your checkbox from the default 'On' in its Options property.

Your code for a classic process should be:
Code: Select all
if (isset(@@checkboxVar001) and @@checkboxVar001== "On") {
   G::SendMessageText("TRUE", "INFO");
} else {
   G::SendMessageText("FALSE", "INFO");
}
If you are using a BPMN process, and you haven't changed the default values of 0 and 1 in the options property of the checkbox, then use this code:
Code: Select all
if (isset(@=checkboxVar001) and @=checkboxVar001 == array("1")) {
   G::SendMessageText("TRUE", "INFO");
} else {
   G::SendMessageText("FALSE", "INFO");
}
You can always use the debugger to figure this stuff out.
REST API Question

I am currently looking at developing a portlet for[…]

Everybody wants to be famous, but nobody wants to […]

Hi, I attached a sample config file, Please check […]

Error clicking on Participated

Hi, I attached a sample config file, Please check […]