Thursday, March 5, 2015

Workflow History Form


The Workflow History form is under Basic >> Inquiries (AX2009)

Now, this form is quite fascinating because of the way it works - Its picks up the User id and then displays only those workflows that are relevant to them. For the Admin, all workflows are visible.

Here's the catch - All workflows are visible to the users assigned to the Admin group. If a user has complete Admin rights over all the modules, but is not a part of the Admin group, it still shows only related workflows.

Peculiar... Yes...

I came across this phenomenon when a client was re-assigning couple permission and were facing a problem with this form, even with complete access on the other modules. Admin group could not be added because of obvious reasons.

After a lot of assigning, re-assigning and manipulating with the user rights, I decided to dig into the code...

And Viola.!!

There is a very specific query that executed when the form is run. This query does not fetch the user id only if the user belongs to the Admin user group. Any other group, with complete access over the system - it will still fetch the user id and display specific details.

Being a Standard form, it is not advisable to play around with the code here. Just to test the case, we added another user group along with Admin, to see if it works. It did.

But.

Not sure why, but the workflows started throwing a Stopped (error) after completion - totally out of the blue. When we restored the original code, the error disappeared as silently as it had crept in. I am still on a lookout for the reason for this unusual behaviour, without any pointers.

The final establishment of the entire experiment was that the Workflow History form has a dependency on the Admin group and not on Users' access on the system. Secondly, fidgeting with the query in the code was not a very good idea.

Anyone out there with a similar problem, there does not seem to be a feasible solution here... In case any of you stumbles upon a hidden area, please share.

Happy daxing :)

No comments:

Post a Comment