The post Entity for Views in CRM based on View Ownership – SavedQuery and UserQuery Entity appeared first on Microsoft Dynamics 365 Blog.
]]>1) Organisation or System View – stored in the View Entity (SavedQuery)
2) Individual, personal or User/Team View – stored in the Saved View Entity (UserQuery)
Below is the Fetch XML that you can use to retrieve the Data of the entites
1) Organisation or System View
<fetch top="5000" >
<entity name="savedquery" >
<attribute name="name" alias="ViewName" />
<attribute name="createdbyname" alias="Owner" />
<attribute name="description" alias="Description" />
<attribute name="returnedtypecode" alias="returnCode" />
<attribute name="fetchxml" alias="fetchXML" />
</entity>
</fetch>
2) Individual, personal or User/Team View
<fetch top="5000" >
<entity name="userquery" >
<all-attributes/>
<attribute name="name" />
<order attribute="name" descending="false" />
<attribute name="ownerid" />
<attribute name="modifiedon" />
<attribute name="userqueryid" />
</entity>
</fetch>
We can retrieve the data of these entries by C# also you can see the full code example here:
https://msdn.microsoft.com/en-us/library/gg594431.aspx
You can also use LINQ query for retrieving these view.
Happy CRMing
The post Entity for Views in CRM based on View Ownership – SavedQuery and UserQuery Entity appeared first on Microsoft Dynamics 365 Blog.
]]>The post Validation to accept only Numeric Character in MS CRM appeared first on Microsoft Dynamics 365 Blog.
]]>function ValidateOnlyNumeric(context) {
Hope it helps
Happy Coding
The post Validation to accept only Numeric Character in MS CRM appeared first on Microsoft Dynamics 365 Blog.
]]>The post Create and Send Email Message Activity from javascript using api D365 / MS CRM 2016 appeared first on Microsoft Dynamics 365 Blog.
]]>Replace the User GUID for to and from user in “fromFieldIdSystemAdmin” and “toPartyUsersId”
function CreateEmail() {
var fromFieldIdSystemAdmin = "53536B3D-4D71-4FC2-857C-0477750A92BE"; //todo Email from User GUID
var toPartyUsersId = ["53536B3D-4D71-4FC2-857C-0477750A92BE"]; //todo Email To user array
var quoteId = Xrm.Page.data.entity.getId();
quoteId = quoteId.replace(/[{}]/g, "");
var customerLookUp = Xrm.Page.getAttribute("customerid");
var accountName = null;
if (customerLookUp != null)
accountName = customerLookUp.getValue()[0].name;
var webapiPath = Xrm.Page.context.getClientUrl() + "/api/data/v8.0/emails";
var email = {};
//Lookup
email["regardingobjectid_quote@odata.bind"] = "/quotes(" + quoteId + ")"; //Regarding is quote
email["subject"] = "Quote Sent ";
email["description"] = "See attachment for the Quote that was set as Won";
var parties = [];
//ActivityParty (From)
var sender = {};
sender["partyid_systemuser@odata.bind"] = "/systemusers(" + fromFieldIdSystemAdmin + ")";
sender["participationtypemask"] = 1; //From
parties.push(sender);
for (i = 0; i < toPartyUsersId.length; i++) {
var receiver = {};
receiver["partyid_systemuser@odata.bind"] = "/systemusers(" + toPartyUsersId[i] + ")";
receiver["participationtypemask"] = 2; //To
parties.push(receiver);
}
email["email_activity_parties"] = parties;
var service = new XMLHttpRequest();
service.open("POST", webapiPath, false);
service.setRequestHeader("Accept", "application/json");
service.setRequestHeader("Content-Type", "application/json; charset=utf-8");
service.setRequestHeader("OData-MaxVersion", "4.0");
service.setRequestHeader("OData-Version", "4.0");
service.send(JSON.stringify(email));
if (service.readyState == 4) {
if (service.status == 204) {
var uri = service.getResponseHeader("OData-EntityId");
var regExp = /(([^)]+))/;
var matches = regExp.exec(uri);
var emailGblId = matches[1];
SendEmail(emailGblId);
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
}
function SendEmail(emailGblId) {
var parameters = {};
parameters.IssueSend = true;
var req = new XMLHttpRequest();
req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.1/emails(" + emailGblId + ")/Microsoft.Dynamics.CRM.SendEmail", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var results = JSON.parse(this.response);
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send(JSON.stringify(parameters));
}
function successCallback() {
}
function errorCallback() {
}
Happy Coding
SOURCE : mscrm.com
The post Create and Send Email Message Activity from javascript using api D365 / MS CRM 2016 appeared first on Microsoft Dynamics 365 Blog.
]]>The post CRM Rest Builder for Dynamics CRM D365 / MSCRM 2013, 2015, 2016 appeared first on Microsoft Dynamics 365 Blog.
]]>For 2015 & 2016 & D365 use the v2.5.0.0 release
For 2011 & 2013 use the v1.5.0.0 release
1) CRM Rest Builder GIT Hub URL
2) CRM Rest Builder Drive v2.5.0.0 , v1.5.0.0
And follow the below steps
Step 1 – Navigate to your Organisation Settings -> Solutions and click on Import Button
Step 2 – Click on to Browse Button
Step 3 – Navigate to the solution file previously downloaded and click on open and then click on Next
Step 4 – Click on to Import Button
Step 5 – After some time you will see the below success message
Step 6 – Now you will be able to see the CRM Rest Builder Button on the ribbon bar on solutions Click on it
And You are good to go with CRM Rest Builder
Happy CRMing
SOURCE : mscrm.com
The post CRM Rest Builder for Dynamics CRM D365 / MSCRM 2013, 2015, 2016 appeared first on Microsoft Dynamics 365 Blog.
]]>