How to: Use Associated Forms Permissions
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.
Add X++ Code to Open the Associated Form
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.
Add a Node under Associated Forms
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:
Expand AOT > Forms > YourParentForm > Permissions > Read > Associated Forms.
Right-click the Associated Forms node, and then click New associated form.
In the Properties window for new associated form node, set the Form property to YourAssociatedForm.
Set the AccessLevel property to Read.
Next Steps
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.
See also
Security Permissions Properties for a Form
Assign users to security roles
How to: Create Menus and Menu Items
Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.