Posts

Filter Customer look up field to show only account.

  You can use the script to filter the customer field to show account or contact records. function setCustomerLookupToShowAccount(executionContext) { var formContext = executionContext.getFormContext(); if (formContext.data.entity.getEntityName() === "contact") {    if (formContext.getControl("parentcustomerid")) {    var company = formContext.getControl("parentcustomerid");        if (company.getEntityTypes().length > 1) { company.setEntityTypes(["account"]);    } } }      } // Register this on load evevnt.

Lead Qualify by java script in dynamics crm 365

function qualifyLead(formContext) {     formContext.ui.setFormNotification("Qualifying lead...", "INFO", "qualifyNotification");     var leadRef = formContext.data.entity.getEntityReference();     var actionRequest = {         entity: leadRef,         CreateAccount: true,         CreateContact: true,         CreateOpportunity: true, // Set this to true to create an opportunity         OpportunityCurrencyId: leadRef.transactioncurrencyid, // Use the currency from the lead         OpportunityCustomerId: null,         SourceCampaignId: null,         Status: 3,         ProcessInstanceId: null     };     Xrm.WebApi.online.executeAction("QualifyLead", actionRequest).then(         function (response) {             if (...

Create Folder On Share Point by using Power Automate In Dynamics CRM

Image
  1-Flow trigger When contact is created 2-Declare two variables one for storing SharePoint site URL and the other one is for the Sotring Entity name. 3-Use SharePoint Connector and take create a new folder action. In the Site address and Library pass the variables and in the folder, the path gives the folder name, whatever you give the path will create a folder accordingly. (here I have given FULL NAME_GUID ) In replace expression I have replaced Guid '-' with ' '.( replace(toUpper(triggerOutputs()?[ 'body/contactid' ]), '-' , '' ) ) 4-After Creating the folder we need to retrieve the parent site document location for the contact for creating a new document location. 5-creating new document location.in this, we provide the site name whatever you want and In the  Relative URL pass the folder path the same as we have given for folder creation action in step no 3. In regarding(contacts) pass contact GUID and  Parent Site or Location (Document Locat...

Duplicate Detection Plugin code for Microsoft dynamics CRM

 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xrm.Sdk; using System.ServiceModel; using Microsoft.Xrm.Sdk.Query; namespace MyPlugins {     public class DuplicateCheck : IPlugin     {         public void Execute(IServiceProvider serviceProvider)         {             // Extract the tracing service for use in debugging sandboxed plug-ins.               // If you are not registering the plug-in in the sandbox, then you do               // not have to add any tracing service related code.               ITracingService tracingService =                 (ITracingService)serviceProvider.GetService(typeof(ITracingService));           ...

Revenue Round Off Plugin code for Microsoft dynamics CRM

 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xrm.Sdk; using System.ServiceModel; namespace MyPlugins {     public class RevenueRoundoff : IPlugin     {         public void Execute(IServiceProvider serviceProvider)         {             // Extract the tracing service for use in debugging sandboxed plug-ins.               // If you are not registering the plug-in in the sandbox, then you do               // not have to add any tracing service related code.               ITracingService tracingService =                 (ITracingService)serviceProvider.GetService(typeof(ITracingService));             // Obtain the execution ...

Create a Task plugin in MS Dynamics CRM

 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Xrm.Sdk; using System.ServiceModel; namespace MyPlugins {     public class TaskCreate : IPlugin     {         public void Execute(IServiceProvider serviceProvider)         {             // Extract the tracing service for use in debugging sandboxed plug-ins.               // If you are not registering the plug-in in the sandbox, then you do               // not have to add any tracing service related code.               ITracingService tracingService =                 (ITracingService)serviceProvider.GetService(typeof(ITracingService));             // Obtain the execution conte...

Power Automate - Update Child record when parent record is updated by using power automate in MS Dynamics CRM

Image
Power Automate - Update Child record when a parent record is updated by using power automate in                                                                  MS Dynamics CRM                                                                     Trigger of the flow List Contacts Related to the Account Update Contacts On the Contacts entity map fields on the contact form from the account which field need to be updated in the account form, here I have mapped the address field from account to contact when the address on the Account is updated then the address on the Contact will also be updated.