Posts

SEND EMAIL through Web API request in MS CRM 2016

‘email‘ is a bound entity to use SendEmail Action. ‘IssueSend‘ is the Boolean parameter to be passed to the action. If ‘IssueSend’ = true, then the email will mark the email to be sent. Activity Status = Pending Send If ‘IssueSend’ = false, then the email will be marked as sent. Activity Status = Sent var parameters =    {        "IssueSend": false    }; var request = new XMLHttpRequest(); request.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.0/emails(5F3753B9-0856-E611-80EA-005056981E85)/Microsoft.Dynamics.CRM.SendEmail", true); request.setRequestHeader("Accept", "application/json"); request.setRequestHeader("Content-Type", "application/json; charset=utf-8"); request.setRequestHeader("OData-MaxVersion", "4.0"); request.setRequestHeader("OData-Version", "4.0"); request.onreadystatechange = function () {     if (this.readyState === 4) {  ...

Execute custom/system ACTION using Web API in MS CRM 2016

//Custom Action with parameters to add a notes to account record. Action unique name: new_customaction. Input Parameter:  Name=’Title’ var notesData = {     "Title": "Sample Notes." }; var query = "accounts(34C77C3E-E6F7-E511-80E5-005056981E85)/Microsoft.Dynamics.CRM.new_customaction"; var request = new XMLHttpRequest(); request.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.0/" + query, true); request.setRequestHeader("Accept", "application/json"); request.setRequestHeader("Content-Type", "application/json; charset=utf-8"); request.setRequestHeader("OData-MaxVersion", "4.0"); request.setRequestHeader("OData-Version", "4.0"); request.onreadystatechange = function () {     if (this.readyState == 4) {         request.onreadystatechange = null;         if (this.status == 200) {             // Successful         }     } };

retriveing the current CRM version using web api request in mscrm

///the complete code for using RetrieveVersion function, which can be used to get current CRM version: function GetCRMVersion() {     //get CRM URL     var serverURL = Xrm.Page.context.getClientUrl();     //write request for function      var req = new XMLHttpRequest();     req.open("GET", serverURL + "/api/data/v8.0/RetrieveVersion()", true);     req.setRequestHeader("Accept", "application/json");     req.setRequestHeader("Content-Type", "application/json; charset=utf-8");     req.setRequestHeader("OData-MaxVersion", "4.0");     req.setRequestHeader("OData-Version", "4.0");     req.onreadystatechange = function() {         if (this.readyState == 4 /* complete */ ) {             req.onreadystatechange = null;             if (this.status == 200)//check response is OK {     ...

how to create report rdl file in mscrm

Image
1. Install Bids Tool in Visual Studio 2. Open new project in VS 3. Templates -> Business Intelligence ->Report Service ->Report Server Project 4. Go to View ->Report Data 5. Click on Data Source -> Add Data Source 6. In Data Source Properties ->Connection String-> Enter Url “/” Oraganization Name and Enter 7. Credentials -> check Use this user name and Password of crm and click Enter 8. Select the Data Sets -> Data Set Properties -> Data Source ->DataSource1 ->Query type(Text) Query(Enter Fetch Xml Code) 9. Enter Values dynamically using Parameters see the below screen shots. Fetchxml code: < fetch version = " 1.0 " output-format = " xml-platform " mapping = " logical " distinct = " false " >   < entity name = " account " >     < attribute name = " name " />     < attribute name = " primarycontactid " />     ...

Calling Action using javascript with web api request in mscrm

Image
// how to Call action Using javascript function hanleWebLead() {     var actionName = new_actioncallusingjs;         //defien action input parameters     var aactionParameters = {         "topic" : $( "#topic" ).val(),         "firstName" : $( "#firstName" ).val(),         "lastName" : $( "#lastName" ).val()     };     var actionResponse = activieCustomAction(actionName, aactionParameters);     alert(actionResponse.newLeadUrl); } function activateCustomAction() {     var Id = Xrm.Page.data.entity.getId().replace( '{' , '' ).replace( '}' , '' );     var serverURL = Xrm.Page.context.getClientUrl();     // pass the id as inpurt parameter     var data = {   ...

Calling a workflow using web api request in mscrm

function executeWorkflow(accountId, workflowId, clientUrl) {     var functionName = "executeWorkflow >>";     var query = "";     workflowId = "1f5bee55-222e-4741-9318-b3236c88ba02";     try {         //Define the query to execute the action         query = "workflows(" + workflowId.replace("}", "").replace("{", "") + ")/Microsoft.Dynamics.CRM.ExecuteWorkflow";         var data = {             "EntityId": accountId//current entity         };         //Create request         // request url         //https://org.crm.dynamics.com/api/data/v8.2/workflows(“f0ca33cc-23fd-496f-80e1-693873a951ca”)/Microsoft.Dynamics.CRM.ExecuteWorkflow         var req = new XMLHttpRequest();         req.open("POST", clientUrl + "/api/data/v8....

create Email and create attachement and send email on demand of workflow using js in smcrm

///creating the email function emailSend() {     debugger;     var caseResult = caseRecordData();     var activityPartyFrom = new Object();     var userId = Xrm.Page.context.getUserId().replace("{", "").replace("}", "")     var emailPartyEntities = [{         PartyId: { LogicalName: CustomerId.LogicalName, Id: custId },         ParticipationTypeMask: { Value: 2 }     }, {         PartyId: { LogicalName: "systemuser", Id: userId },// Xrm.Page.context.getUserName() { LogicalName: Xrm.Page.context.getUserName(), Id: userId },         ParticipationTypeMask: { Value: 1 }     }];     var email = {         Subject: Title,//"purushotham",//emailSubject, /* "MTC Microsoft CRM Proposal/Invoice - ApprovalRequested",*/         MimeType: "text/html",         Descript...