Tip – how to remove the option of creating a new record directly from the lookup field
Scenario:
The requirement is to remove the option of creating a New Contact in the Customer Name field on the Case form
Solution #1:
This can be controlled by restricting create privileges using Security Roles.
Solution #2:
Modification of an unmanaged solution file is supported as described in this documentation.
- Form and dashboard customization using FormXml.
Luckily there is an option within the form XML schema that allows exactly the desired behavior. Adding the tag <IsInlineNewEnabled>false</IsInlineNewEnabled>
(usually this tag is not present in formXml), will remove the button for all users no matter what their privileges allow. The provided solution is supported and works for Dynamics Customer Engagement on-premises as well as current Power Platform model-driven apps.
Procedure
- Create an unmanaged solution containing only the form
- Export the solution zip file and extract it to disk
- Locate the lookup control based on its schema name in
customizations.xml
- Add
IsInlineNewEnabled
tag to control’s parameters collection - Zip the contents of the extracted folder including your modified
customizations.xml
- Import the newly created solution zip file and publish all changes
- Verify that the button is gone now
The parameters of your lookup instance might not match the ones shown here. Or in case you did not set any additional parameters via form editor might not even be present at all. In that case just add a parameters tag including the tag IsInlineNewEnabled
.
<?xml version="1.0" encoding="UTF-8"?><control id="new_contractid" classid="{270BD3DB-D9AF-4782-9025-509E298DEC0A}" datafieldname="new_contractid" uniqueid="{8dcea322-b6ee-5a9b-a429-b47dc98d75a7}"> <parameters> <AutoResolve>true</AutoResolve> <DisableMru>false</DisableMru> <DisableQuickFind>false</DisableQuickFind> <DisableViewPicker>false</DisableViewPicker> <AllowFilterOff>false</AllowFilterOff> <IsInlineNewEnabled>false</IsInlineNewEnabled> </parameters></control>
Source: Supported customizations for Microsoft Dataverse (Dataverse) – Power Apps | Microsoft Docs
This was originally posted here.
*This post is locked for comments