Dynamics 365





Showing posts with label Activities Filter. Show all posts
Showing posts with label Activities Filter. Show all posts

Thursday, July 23, 2020

Dynamics 365 - condition to check owner is team or user while send email

In dynamics 365 while sending emails on assigning Case or any other entity record  Required to send an email to user. here We may assign case to team initially and then to user manually . CRM may not send email to team . It can send email to user., so in work flow we need to check for the whether owner is team or user .

we can check using below condition as shown in below figure.




Monday, November 27, 2017

Loading IFrame on form - MS CRM Dynamics javascript

This is helpful to set the URL to IFRAME using javascript in MicroSoft Dynamics CRM.

use below script as reference to your javascript webresource.

you need to call the SetTransactionFrame() from onload even and save event of crm form.

// script to webpage to Iframe .. load web page on MS CRM form IFRAME.



var transactionsURL = "http:blogger.com";

function SetTransactionFrame()
{

 var subjectValue = Xrm.Page.getAttribute("subjectid").getValue();

 if ((subjectValue != null)) {
 
var subjectName = subjectValue[0].name;


var formType = Xrm.Page.ui.getFormType();
    if (formType !== 1 && subjectName=="yoursubject" )
        {
SetIFrameURL();
}
else
{
//"Details" - tab name
Xrm.Page.ui.tabs.get("Details").sections.get("Details_section_2").setVisible(false);
}

   }
}

function SetIFrameURL() {

    var CaseId = Xrm.Page.data.entity.getId();
    var UserId = Xrm.Page.context.getUserId();
   var FormType ="case";

    var transactionsURL = TransactionDetailsURL + '?id=' + CaseId +'&userid=' +UserId +'&typename='+FormType;


Xrm.Page.getControl('IFRAME_Transactions').setSrc(transactionsURL);
}

Thursday, March 9, 2017

Default Activity ‘Next 30 days or earlier’ to ‘All’ Dynamics CRM 2016


here is the javascript code to change the default filter of Account or Contact - Activities Filter to "All"

Default Activity ‘Filter on’ to ‘All’ Dynamics CRM 2016


Create a web resource on Account or Contact entity
Call below function on onLoad of Account or Contact entity.



function filterAllActivities() 
{
    parent.window.document.getElementById("navActivities").onclick = function () 
    {
           parent.window.Mscrm.Details.loadArea(this, "areaActivities");
           parent.window.document.getElementById("areaActivitiesFrame").onload = function () 
           {
               var entityName = Xrm.Page.data.entity.getEntityName();
              var entity = entityName.charAt(0).toUpperCase() + entityName.substr(1);
               var doc = this.contentWindow.document;
               var filterOn = doc.getElementById("crmGrid_" + entity + "_ActivityPointers_datefilter");
    
               filterOn.value = "All";
    
            var evt = document.createEvent("HTMLEvents");
            evt.initEvent("change", false, true);
            filterOn.dispatchEvent(evt); 
         };
    };