Thursday, October 3, 2019

JavaScript to check run on UCI or not in Microsoft Dynamics CRM

function isUCI(){
        var globalContext = Xrm.Utility.getGlobalContext();
        var t1 = globalContext.getCurrentAppUrl();
        var t2 = globalContext.getClientUrl();
        if (t1 !== t2)
            return true;

    return false;
}

Thursday, September 19, 2019

Trigger Javascript on Sub-Grid

Dear All,

Today we got a requirement to trigger Javascript on Add or Delete Value from Subgrid.

Please find the code below for the same

var contactsSubgrid = Xrm.Page.getControl("Contact");

    var myContactsGridOnloadFunction = function () {
        //Trigger your function or Code here

    };

    contactsSubgrid.addOnLoad(myContactsGridOnloadFunction);

Tuesday, May 14, 2019

Online MSCRM + A managed solution cannot overwrite the AttributeMap component with Id={GUID} which has an unmanaged base instance. The most likely scenario for this error is that an unmanaged solution has installed a new unmanaged AttributeMap component on the target system, and now a managed solution from the same publisher is trying to install that same AttributeMap component as managed. This will cause an invalid layering of solutions on the target system and is not allowed.

HI All,

Please find the below FetchXML, to find the AttributeMap with Source and Destination Fields from MSCRM

string ss = "<fetch version='1.0' mapping='logical' distinct='false'>
<entity name='entitymap'>
<attribute name='sourceentityname'/>
<attribute name='targetentityname'/>
<link-entity name='attributemap' alias='attributemap' to='entitymapid' from='entitymapid' link-type='inner'>
<attribute name='sourceattributename'/>
<attribute name='targetattributename'/>
<filter type='and'>
<condition attribute='attributemapid' operator='eq' value='{GUID}' /> // Pass your GUID from the Solution Error
</filter>
</link-entity>
</entity>
</fetch>";

Tuesday, April 10, 2018

Unable to Login to Dynamics CRMOrganizationWebProxyClient is nullOrganizationWebProxyClient is nullOrganizationServiceProxy is nullOrganizationServiceProxy is null

Hi All,

If any one facing the issue in Console application while connecting to MSCRM(onpremises) with IFD as Unable to Login to Dynamics CRMOrganizationWebProxyClient is null. Use the below connection string to made it work

Old Code:

CrmServiceClient crmConn = new CrmServiceClient("AuthType=IFD; Url=https://ServerName/Orgname; Domain=domainName; Username=username; Password=password");

Change the Old Code to New Code as Below

CrmServiceClient crmConn = new CrmServiceClient("AuthType=IFD; Url=https://ServerName/Orgname; Domain=domainName; Username=username@domainName; Password=password");



Monday, February 19, 2018

Get the Created Records when Lead Gets Qualified - Microsoft dynamics CRM

Hi All,

Once Lead Gets Qualify, as per oob behavior it will automatically create opportunity, contact and accounts.

As per my logic whenever an opportunity gets created need to set created lead id to custom opportunity field.

Plugin Step Creation:


Register Plugin as Asynchronously


            IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
            IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
            IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
            OrganizationServiceContext orgContext = new OrganizationServiceContext(service);

EntityReference getLeadid = (EntityReference)context.InputParameters["LeadId"];
Entity lead = service.Retrieve("lead", leadid.Id, new ColumnSet(true));

foreach (EntityReference CreatedEntityFromLead in ((IEnumerable)context.OutputParameters["CreatedEntities"]))
                {
                    if (CreatedEntityFromLead.LogicalName == "opportunity")
                    {
                        Entity entOpportunity = service.Retrieve("opportunity", CreatedEntityFromLead.Id, new ColumnSet(true));
                         entOpportunity["new_customLookupid"] = erLookUpField;
                        service.Update(entOpportunity);
                    }

                }




Tuesday, February 6, 2018

Selection Count Rule - Display Custom ribbon button only if atleast single record is selected in a Home Page

Hi All,

Display Custom ribbon button only if at-least single record is selected in a Home Page

Add the Below Enable Rule to the Custom Created Command and publish it.

Enable Rule:





Monday, February 5, 2018

ILMerge Visual Studio

Hi All,

As we already Known that ILMerge we can use to Merge dll’s, in some situation we can’t find the proper expectation Solution while Surfing. So am writing this blog for my safe and Global if needed.

In below Scinario I need to merger workflow.dll + Newtonsoft.json.dll + strongfile.snk = Workflow_Merged.dll

"$(TargetDir)\ILMerge.exe" "$(TargetDir)Workflow.dll" "$(TargetDir)\Newtonsoft.Json.dll" "/keyfile:$(SolutionDir)Workflow\Workflow.snk" /out:"$(TargetDir)\Workflow_Merged.dll"

Note:
Download ILmerge from : ILMerge
(TargerDir) --> Root Directory
(SolutionDir) --> Solution Directory

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...