Thursday, December 3, 2020

Filter Lookup based on Linked Entity MSCRM

 function AddCustomContactView(executionContext) {

            var formContext = executionContext.getFormContext();
            if(formContext.getAttribute("account").getValue()!=null)
            {
            var accountId = formContext.getAttribute("account").getValue()[0].id;
            var viewId = "34A611CD-8503-4DE0-8EB7-B16EEAB32EBF";
            var entity = "contact";
            var ViewDisplayName = "Contacts";
            var fetchXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
                "<entity name = 'contact' >" +
                "<attribute name='fullname' />" +
                "<attribute name='telephone1' />" +
                "<order attribute='fullname' descending='false' />" +
                "<link-entity name='account' from='accountid' to='parentcustomerid' link-type='inner' alias='ab'>" +
                "<filter type='and'><filter type='or'>" +
                "<condition attribute='accountid' operator='eq' uitype='account' value='" + accountId + "' />" +
                "<condition attribute='accountid' operator='under' uitype='account' value='" + accountId + "' />" +
                "</filter></filter></link-entity></entity></fetch >";
            var layout = "<grid name='resultset' jump='fullname' select='1' icon='1' preview='1'>" +
                "<row name = 'result' id = 'contactid' >" +
                "<cell name='fullname' width='300' />" +
                "<cell name='telephone1' width='125' />" +
                "<cell name='emailaddress1' width='150' />" +
                "</row></grid>";
 
            formContext.getControl("contact").addCustomView(viewId, entity, ViewDisplayName, fetchXML, layout, true);
 
        }
}

Saturday, November 28, 2020

MSCRM Email Plugins C# with and Without CRM Reference

 // Create a new activity party linked to a contact

Entity party1 = new Entity("activityparty"); party1["addressused"] = "some@email.com"; party1["partyid"] = new EntityReference("contact", contactId); // Create a new unresolved activity party Entity party2 = new Entity("activityparty"); party2["addressused"] = "unresolved@email.com"; // Create a new EntityCollection and add the 2 parties EntityCollection to = new EntityCollection(); to.Entities.Add(party1); to.Entities.Add(party2); // Create an email with the EntityCollection Entity email = new Entity("email"); email["subject"] = "Test Party Lists"; email["to"] = to; Guid _emailid = service.Create(email);

    if (_emailid != Guid.Empty)
    {
        SendEmailRequest sendEmailreq = new SendEmailRequest
        {
            EmailId = _emailid,
            TrackingToken = "",
            IssueSend = true
        };

        SendEmailResponse sendEmailresp = (SendEmailResponse)service.Execute(sendEmailreq);
    }

How to Clear Cache in Canvas PowerApps while working on Offline mode?

  Introduction In this blog, we’ll look at how to clear cache in Canvas Apps when using the Power Apps mobile application, especially when t...