Rollbase workflow action validation

Posted by matman on 24-Sep-2014 09:30

I'm currently making a little demo exercise and ran into a validation problem. Because you need to understand my situation for this, I'll explain my scenario:

After a user has checked all the checkboxes of status #1, the user can switch to status #2.

There are two ways to switch to status #2. The first one is by editing the record, and then selecting status #2 from the 'Status' dropdown field, created by the Workflow process. The second way is to press the Workflow action 'Switch to status #2'.

Because the user must first check a 'Do you want to proceed?' checkbox, the first method to switch to status #2 has been disabled as the user can only check this checkbox on the status page. I disabled this first method using the 'Status' field validation.

Okay so we have to use the second method, via the workflow action. Here comes the problem: Because I only want to show the 'Switch to status #2' action after the user checked all checkboxes, I can no longer use the action's execution condition as a validation for the confirmation checkbox. Since I cannot, I must find another way to verify the check before executing the action.

So there are a couple ways I imagined. The first way was by using the Status field validation, because the status changes when executing the action. After some testing I discovered that the status field validation is completely ignored when executing a status changing action.

The second way I imagined was by using a validation trigger, because the documentation stated that validation triggers are executed even before the 'Before Update' triggers. Apparently, the 'Before Before Update' triggers are executed after the action has finished execution. Which makes them impossible to use as well.

There are basically two ways I know of now to work around this issue:

  1. Put a  validation script on the status change page to verify the user has checked the confirmation checkbox. However, since it's client side it's unreliable and can be hacked easily.
  2. Put the confirmation checkbox on the edit page (making the status change page useless in my case).

And I also have three suggestions:

  1. Execute validation triggers during or before the execution of the action.
  2. Implement status field validation inside the action, because in my case the field will be updated during the action.
  3. Create another condition for Workflow actions: Instead of one for both execution and display, make one for display and an optional one for execution (and if execution condition empty, treat display condition as one for both display and execution).

Does anyone know a way to work around my problem, but by keeping this scenario the same?

All Replies

Posted by Gian Torralba on 24-Sep-2014 09:40

Hello,

You can add the validation on the workflow action formula condition itself. Adding the condition in the workflow action will prevent the user from seeing the workflow action which changes the status to #2.

Does this make sense? Let me know if I understand the scenario correctly.

Thank you,
Gian

Posted by matman on 24-Sep-2014 09:42

Unfortunately I already use this to prevent seeing the workflow action on the edit page (page #1), so I cannot use it to validate a checkbox on the status change page (page #2).

Posted by Gian Torralba on 24-Sep-2014 09:51

Hello,

Are you saying that you are using the same "Proceed to next status" checkbox on both page? I'm thinking that maybe you can reset the checkbox value so that you can use it again to validate in the next status page.

Thank you,
Gian

Posted by matman on 24-Sep-2014 09:54

No, I'm only using the confirmation checkbox on the second page.

Posted by Gian Torralba on 24-Sep-2014 10:05

Hello,

You mentioned that "After a user has checked all the checkboxes of status #1, the user can switch to status #2" and also "Because I only want to show the 'Switch to status #2' action after the user checked all checkboxes" Please clarify if I'm wrong. Do you need to disable the workflow action to status #2 if the checkbox are not checked right?

Thank you,
Gian

Posted by matman on 24-Sep-2014 10:12

Yes, after the user checked all checkboxes on the edit page of status #1, the user will be able to see the "Switch to status #2" action link. When clicking this he'll be transfered to the Status change page, where he has to check the confirmation checkbox. When he has checked this last box, he'll actually be able to change the status.

Posted by Gian Torralba on 24-Sep-2014 10:23

Hello,

I see. When you say that "the user checked all checkboxed on the edit pag eof status #1" Is this the same checkbox in the status change page? Sorry for any misunderstanding.

Thank you,
Gian

Posted by matman on 25-Sep-2014 02:48

Don't worry! I'll use some pictures to explain it a bit better:

Edit page

Status change page


As you can see they're not the same checkbox. The 'Entered and appointed employee' checkbox is a final checkbox that needs to be checked before going to the next workflow status.

Posted by Gian Torralba on 26-Sep-2014 15:15

Hello,

I see where the confusion lies. You are displaying the workflow action in the edit page itself. Can you add the workflow action in the view page instead so that the user needs to check the entered customer checkboxes first and then after saving the record, the workflow action #2 will show?

Thank you,

Gian

Posted by matman on 29-Sep-2014 03:49

I managed to work around the problem. I set the workflow action's condition so it'll only show when all these customer checkboxes are checked. Also, this small issue took me way too much time to fix, but I simply added a validation on the final checkbox.

I can imagine the text I posted in my first post was a bit hard to take in, seeing that it's a huge text. So thanks a lot for the help!

I'd like to ask Rollbase devs a final question: why is the 'Status' field validation skipped when executing a status changing workflow action?

Posted by Gian Torralba on 30-Sep-2014 10:17

Hello,

The explanation for this is because field validation only works inside the page form. If you try to put the workflow status field inside the workflow action change status page and then return an error inside the formula validation it will work as expected.

I hope this helps.

Thank you,

Gian

Posted by matman on 30-Sep-2014 11:31

Ah I see! But that also means it's very important that I don't forget to verify that the user didn't just remove the status field from the status change page right?

Thanks!

Posted by Gian Torralba on 30-Sep-2014 17:26

Hello,

You don't actually need to put the status field there because you are basically changing the field itself via the workflow action. I was just giving it as an example on how the field validation works. Let me know if you have more questions.

Thank you,
Gian

Posted by matman on 01-Oct-2014 02:20

Thans for your reply! How would I be able to prevent the execution of a status changing workflow action?

Posted by Gian Torralba on 01-Oct-2014 10:44

Hello,

You can try to add the field validation on the available fields in your workflow action page instead. I believe that's the only way unless you want to create a trigger validation instead.

Thank you,

Gian

Posted by matman on 02-Oct-2014 02:28

I added a validation trigger to the workflow action, but it's executed after the status change. So when I click the action, the status changes and I'm redirected back to the page where I see the following error message:

"Error! Action "Received materials" has been performed on "mysite.com".

Error executing Trigger: "test" How 'bout no! "

I can only use the field validation, which I shall use to reach my goal.

Posted by Gian Torralba on 08-Oct-2014 11:50

Hello matman,

Do you still have any questions about how the field validation works?

Thanks,

Gian

This thread is closed