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:
And I also have three suggestions:
Does anyone know a way to work around my problem, but by keeping this scenario the same?
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
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).
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
No, I'm only using the confirmation checkbox on the second page.
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
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.
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
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
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?
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
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!
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
Thans for your reply! How would I be able to prevent the execution of a status changing workflow action?
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
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.
Hello matman,
Do you still have any questions about how the field validation works?
Thanks,
Gian