We can specify Status Reason Transitions for Case as well as custom entities. Using the status reason dialog box, we can define (filter) which values are available to be set as next status reason.
Let us take a scenario where we have the following values defined for Status Reason for Active State in a custom entity named Test Entity.
Just to keep it simple we have a just on transition defined i.e. from A1 we can only select A2.
So now when a user creates the Test entity record with A1, the only other option user can select is A2.
Now let us try updating it through backend and set value as A3 for the same record with value A1 as status reason. (Here we have used SQL 4 CDS plugin)
Well, it updates the record with value A3 and doesn’t throw any error.
This would make us think that it only works from the client side and will not work from the server side.
Let us now create a workflow to update the value to A3.
Let us update the subject of the record to trigger the workflow for the below record.
Interestingly we get the error and are not able to set it to A3 as expected.
That was with the real-time workflow, for the asynchronous workflow also we get the error.
Let us give it one more try and update it through service.
Through the service call, we can update it.
So basically, the State transition rules will work as expected from user interface and workflows, however, through service we are still able to override it, which we need to be aware of before using this feature.
Hope it helps..
Reblogged this on Debajit's Dynamic CRM Blog and commented:
Awesome tips on Status Transition!
LikeLike