How to: Use Associated Forms Permissions [AX 2012]

Updated: September 29, 2011

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Suppose YourParentForm form has a button that opens YourAssociatedForm form. In such cases, permissions should be added so that YourAssociatedForm is accessible by users of YourParentForm. You can accomplish this by referencing YourAssociatedForm with a node that you add under
 AOT > Forms > YourParentForm > Permissions > Read > Associated Forms.

You can add a button to the YourParentForm form that uses X++ code to open the YourAssociatedForm form. The following code example shows how to open a form when the button is clicked.

void clicked()
{
    FormRun formRun;
    Args args;
    args = new Args("YourAssociatedForm");
    formRun = classFactory::formRunClassOnClient(args);
    formRun.run();
    formRun.wait();

    super();
}

For information about how to add a button to a form, see Walkthrough: Creating a Form by Using the AOT.

In this section, you use the AOT to add a node in the permissions section of YourParentForm form that specifies permissions for the YourAssociatedForm form The following steps show how to add the associated form:

  1. Expand AOT > Forms > YourParentForm > Permissions > Read > Associated Forms.

  2. Right-click the Associated Forms node, and then click New associated form.

  3. In the Properties window for new associated form node, set the Form property to YourAssociatedForm.

  4. Set the AccessLevel property to Read.

You can specify only potential permissions under
 AOT > Forms > YourParentForm > Permissions.
To create actual permissions that can be associated to a role, you must reference the potential permissions under
 AOT > Security > Privileges.

For more information, see Automatic Inference of Permissions in AOT Security.


Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.

Community Additions

ADD
Show: