Create New Entity from related entity via Ribbon – CRM 2013 & CRM 2015

The fastest way to create a new child record for the current entity using a custom ribbon button, is the following approach: Pass the following parameters to your custom javascript function called CreateNewCRMEntity (for example), as shown in the below image: The next step is to use the following code: function CreateNewCRMEntity(selectedentitytypecode, primaryentitytypecode, firstprimaritemid, PrimaryControl,… Continue reading Create New Entity from related entity via Ribbon – CRM 2013 & CRM 2015

Hide New Button on Lookups and Subgrids – CRM 2013 & 2015

Sometimes, you don’t want the New button to be available for creating new records from a lookup or subgrid’s lookup: In order to hide the standard New button on a lookup, use the following function (works on both CRM 2013 and CRM 2015): function RemoveNewButtonFromLookUp(lookupName) { if(lookupName) { var lookUpControl = Xrm.Page.getControl(lookupName); if(lookUpControl) { lookUpControl.addPreSearch(function… Continue reading Hide New Button on Lookups and Subgrids – CRM 2013 & 2015