Category: Howto

Blog, Development, Howto

How to share record with user using WebApi

You can use following code to share record (account in this case) with user (but you can share it with team as well) using JavaScript and WebApi without any additional development: var target = { “accountid”: “ACAAB842-21C7-E811-A96F-000D3A16A41E”, //put <other record type>id and Guid of record to share here “@odata.type”: “Microsoft.Dynamics.CRM.account” //replace account with other record …

Blog, Development, Howto

How to call QuerySchedule using WebApi

Following code can be used to call QuerySchedule function using WebApi: var context; if (typeof GetGlobalContext === “function”) { context = GetGlobalContext(); } else { context = Xrm.Page.context; } var start = new Date(); //Put Start datetime here var end = new Date(); //Put End datetime here end.setDate(end.getDate() + 1); var requestUrl = “/api/data/v8.2/QuerySchedule(ResourceId=@p1,Start=@p2,End=@p3,TimeCodes=@p4)”; requestUrl …

Blog, Development, Howto

How to Add Item to Campaign using WebApi

Following JS (with small changes) can be used to add Marketing List/Product/Sales Literature to Campaign: var parameters = { Campaign: { campaignid: “E5EE91B6-7A75-E811-A95F-000D3A33EB4E”, //put valid if of campaign here “@odata.type”: “Microsoft.Dynamics.CRM.campaign” } }; var context; if (typeof GetGlobalContext === “function”) { context = GetGlobalContext(); } else { context = Xrm.Page.context; } var req = new …

Blog, Development, Howto

How to generate Excel Template from code

2 years ago as a part of Dynamics CRM 2016 release Microsoft introduced “Word/Excel Document Templates”. I saw examples how to generate Word template but have never seen the same example for Excel. Here is what I found after several hours spent with DB of CRM and ILSpy: var request = new OrganizationRequest(“RenderTemplateFromView”); request[“Template”] = …

Development, Howto

How to use SendEmailFromTemplate action with JavaScript and WebApi

var parameters = { TemplateId: “07B94C1D-C85F-492F-B120-F0A743C540E6”,//Guid of template Regarding: { contactid: “CA26BD09-62B4-E711-A94F-000D3A109280”,//entity that will be used for templating “@odata.type”: “Microsoft.Dynamics.CRM.contact” }, Target: {//stub of email that has to contain at least one valid recipient “@odata.type”: “Microsoft.Dynamics.CRM.email”, email_activity_parties: [{ “partyid_contact@odata.bind”: “/contacts(CA26BD09-62B4-E711-A94F-000D3A109280)”, participationtypemask: 2//To }] } }; var context; if (typeof GetGlobalContext === “function”) { context = …

Development, Howto

How to Add records to Marketing List using WebApi

Following code can be used to add records to Marketing List using JavaScript and WebApi: var parameters = { List: { listid: “9DEE7D76-611D-E811-A95B-000D3A1087A0”, “@odata.type”: “Microsoft.Dynamics.CRM.list” }, Members: [{ accountid: “3653A521-A2C0-E711-A950-000D3A109280”, “@odata.type”: “Microsoft.Dynamics.CRM.account” }] }; var context; if (typeof GetGlobalContext === “function”) { context = GetGlobalContext(); } else { context = Xrm.Page.context; } var req = …

Blog, Development, Howto, Reports

Microsoft Dynamics 365 v9.0: How to fix connectivity issues between SSDT + Report Authoring Extension and Dynamics 365

At the moment (February 14, 2018) Microsoft hasn’t released version of Report Authoring Extension that supports both v9.0 and enforced TLS 1.2. This post will help people who develops reports for latest Dynamics 365 v9.0 using SQL Server Data Tools and FetchXml Authoring Extension.

Development, Howto

Microsoft Dynamics 365 v9.0: Usage of new OOB WebApi functions – Part 2

In previous post I described how to perform CRUD operations using OOB wrapper for WebApi operations released as a part of v9.0 release. In this I will describe 2 remaining methods – execute and executeMultiple. Methods are used to execute actions or functions.

Development, Howto

Microsoft Dynamics 365 v9.0: Usage of new OOB WebApi functions – Part 1

It was anounced earlier that wrapper for usage of WebApi will be available as a part of v9.0 release. Now v9.0 is released so it became possible to check what can it do and what we can do with it.