How to Hide the "New" Button in Lookup Dialogs on Dynamics 365 and Power Platform Model-Driven Apps

How to Hide the "New" Button in Lookup Dialogs on Dynamics 365 and Power Platform Model-Driven Apps

Introduction:

In Dynamics 365 and Power Platform model-driven apps, users with create privileges see a "New" button in lookup dialogs, which might lead to unintended record creation. While useful in some scenarios, this feature may conflict with business processes requiring the use of existing records only.

Directly hiding this button via form editor is not supported, and adjusting user privileges may not be an ideal solution. This article outlines a supported technique to remove the "New" button from lookup dialogs by modifying the form XML schema, applicable to Dynamics Customer Engagement on-premises and Power Platform model-driven apps, ensuring data consistency and adherence to business rules.

Procedure:

  1. 1. Create an Unmanaged Solution: Start by creating an unmanaged solution in Dynamics 365. Add only the form where you wish to hide the "New" button from the lookup dialog.


  2. 2. Export the Solution: Export the unmanaged solution as a zip file and extract its contents to a folder on your disk.


  3. 3. Modify the Form XML: Open the customizations.xml file located in the extracted folder. Search for the lookup control by its schema name. You will need to modify this control's parameters within the XML.


  4. 4. Add the IsInlineNewEnabled Tag: Within the control's parameters collection, add the following XML tag:

    <IsInlineNewEnabled>false</IsInlineNewEnabled>

    This tag may not be present initially in the form XML. If there are no parameters set for the lookup control, you'll need to add a parameters tag enclosing the IsInlineNewEnabled tag.



  1. 5. Repackage and Import the Solution: After modifying the customizations.xml file, repackage the contents of the folder into a new zip file. Import this zip file back into Dynamics 365 and publish all changes.


  2. 6. Verification: Open the form where the lookup control was modified. The "New" button should now be hidden from the lookup dialog, regardless of the user's privileges.



Conclusion: This solution offers a way to enhance data integrity and streamline user experiences by preventing unnecessary record creation directly from lookup dialogs. By carefully editing the form XML, organizations can achieve greater control over their Dynamics 365 and Power Platform model-driven apps without compromising on user privileges.

Note: The above solution is supported and maintains compatibility with future updates to Dynamics 365 and Power Platform.

This method ensures that the interface is tailored to fit specific business needs, promoting accuracy and efficiency in data management practices.

No comments:

Post a Comment