Wednesday, January 31, 2018

Failed to log in Dynamics AX - workflow error

Check users access  in Workflowdocument class

Get List of user doesn't have proper access for class-SysWorkflowDocument

Create New class

public static server void main(Args _args)
{
    container   result, args;
    UserInfo    UserInfo;

    while select id from UserInfo
    {
        try
        {
            new RunAsPermission(UserInfo.id).assert();
            result = runAs(UserInfo.id, classNum(SysWorkflowDocument), staticMethodStr(SysWorkflowDocument, assertAsUser), args);
            CodeAccessPermission::revertAssert();
        }
        catch
        {
            CodeAccessPermission::revertAssert();
            info(UserInfo.id);
        }
    }
}

No comments:

Post a Comment

Search hierarchy for a match (TableALLGroup) X++

  Table1 ppt;  select firstonly ppt  order ItemCode, ItemRelation, AccountCode, AccountRelation where      (ppt.ItemCode == TableGroupAll::T...