Posts

Showing posts from June, 2022

Hide +New Record button in Dynamics 365 lookup Field

Image
In Dynamics 365 Lookup DataType Attribute +New Record Button visible by default when User has Create privileges.      If we want to hide the  +New Record Button We are able to do that using JavaScript.     I am providing code for that at the end of this blog and you can check it.        Above script 1)      lookUpLogicalName variable value is used as   “parentcustomerid” you can replace this with your lookup Attribute LogicalName. 2)      If you want to Hide +New Record Button IsInlineNewEnabled should be "false" Below line is syntax: lookupAttributeControl.controlDescriptor.Parameters.IsInlineNewEnabled="false";   If you want to show that again +New Record Button IsInlineNewEnabled should be "true" Below line is syntax: lookupAttributeControl.controlDescriptor.Parameters.IsInlineNewEnabled="true";   After following steps 1 and 2, Open that Entity Form and Develope...

Hide New Button In Lookup Field In Microsoft Dynamics 365 Using Javascript

1)In below code replace  "new_account"  with your Lookup Attribute Logical Name. 2)Add HideNewButtonInLookupControl  javascript function in to your script and updated script file Into the CRM. 3)Register Onload Event For Form and Pass the  executionContext. function HideNewButtonInLookupControl ( executionContext ){                     try {                         var formContext = executionContex t. getFormContext ();                    var lookUpLogicalName = "new_account" ;                    var lookupAttributeControl = formContext . getControl ( lookUpLogicalName );                    if ( lookupAttributeControl !==  undefined &&  lookupAttributeControl !== null ){...