D365 General Archives - Page 10 of 30 - - Page 10

Category Archives: D365 General

D365 Unified Interface: Enabling embedded legacy dialogs

Introduction: Quite simply put, some of the embedded dialogs like the Advanced Find, Merge Records, Assign & Edit record windows which are not by default visible on the Unified Client Like when you multi-select records, you can’t see the typical Merge, Edit buttons on the ribbon. Here’s how you enable them. System Settings: In your Web Application’s system settings, you have an option under general where you can enable these buttons in the Unified Interface. Now, you can retain those buttons in the Unified Interface as well. Have a great time exploring Unified Interface!

Share Story :

Activate Order button is not working on Order Entity in UCI

Posted On October 10, 2018 by Admin Posted in

Introduction: This blog explains an alternative approach to Activate an Order in UCI. Scenario: We are using Prospect to Cash solution to integrate Sales Order from Sales to Operations (CRM To Operations). In UCI Activate Order button is not working which is used for Order Integration. In this blog we will see an alternative approach to achieve this. Pre-Requisites:    D365 Sales    Microsoft Flow Steps to be followed: Dynamics 365 – 1. Create Custom “Activate Order” button in UCI. 2. Add below JavaScript code which will trigger on Click of “Activate Order” Button. (This code will take the Order Guid and pass it to the http post request) Refer this blog to understand more about HTTP Post Request using Microsoft Flows: https://www.cloudfronts.in/http-post-requests-using-microsoft-flows/ // JavaScript source code CallMSFlowsToActivateOrder: function () { var entityGuid = Xrm.Page.data.entity.getId(); entityGuid = entityGuid.replace(“{“, “”).replace(“}”, “”); var data = JSON.stringify({ “OrderID”: entityGuid }); var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener(“readystatechange”, function () { if (this.readyState === 4) { console.log(this.responseText); } }); var xhr = new XMLHttpRequest(); xhr.open(“POST”, “URL Created From MS Flow”, true); xhr.setRequestHeader(‘Content-Type’, ‘application/json’); xhr.send(JSON.stringify({ “OrderID”: entityGuid })); } Microsoft Flow: 1. Create Flow from Blank. 2. Select the Http request is received trigger. 3. Add below in Request body JSON Schema 4. Add Get Record Trigger of Dynamics 365. In Item identifier pass the OrderId from the Dynamic Content. 5. List all related Sales Order Product of that Order. 6. Add apply to each control and update the value of Order is Active field. 7. Update the Processing state field of Order entity. Overall Flow:

Share Story :

Identify who imported the solution – Dynamics 365 CRM

Introduction: Sometime there is a need to know when and who imported the solution in to CRM. This will be done by XrmToolBox plugin called “Solution History”. Purpose of Solution History: The purpose of the tool is to view a historical list of solutions that have been imported. This provides sort of audit functionality for solutions, as the OOB solution view doesn’t really display how many times a solution has been imported, version number that was updated, error/warning messages that were encountered during solution import. Steps: Install Solution History plugin from Plugin Store in XrmToolBox. Open the plugin and connect to the environment. Select the time frame for the solution. The solutions will be displayed as below. Select the solution for which you want to check the details. Click on Load Solution History. The details will be shown as highlighted below. Other methods of knowing this are listed below: 1) Looking in to the database 2) Checking XML Hope this helps!!

Share Story :

[SOLVED] “Corrupted report PDF generated using JavaScript” in Dynamics 365 V9.0

Posted On October 9, 2018 by Clinton D'Mello Posted in Tagged in

Introduction We had developed a functionality for Dynamics CRM v8.2 on Quote Entity by adding a custom button and on clicking a button we run a report, capture its contents using JavaScript, convert it to a PDF and attach the PDF to an Email Record. Below shown is the code snippet quoteInvoice = { runReportToPrint: function () { debugger; var params = quoteInvoice.getReportingSession(); var newPth = Xrm.Page.context.getClientUrl() + “/Reserved.ReportViewerWebControl.axd?ReportSession=” + params[0] + “&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=” + params[1] + “&OpType=Export&FileName=public&ContentDisposition=OnlyHtmlInline&Format=PDF”; //Calling the below function converts the report to PDF format. quoteInvoice.convertResponseToPDF(newPth); }, getReportingSession: function () { var selectedIds = Xrm.Page.data.entity.getId(); selectedIds = selectedIds.replace(‘{‘, ”).replace(‘}’, ”); var strParameterXML = “<fetch distinct=’false’ mapping=’logical’ output-format=’xml-platform’ version=’1.0′><entity name= ‘quote’><all-attributes/><filter type=’and’><condition attribute=’quoteid’ value='” + selectedIds + “‘ operator=’eq’ /></filter></entity ></fetch >”; var reportGuid = “DAF05843-CA33-E711-811E-FC15B42827EC”; var reportName = “Quote Invoice.rdl”; var pth = Xrm.Page.context.getClientUrl() + “/CRMReports/rsviewer/QuirksReportViewer.aspx”; var retrieveEntityReq = new XMLHttpRequest(); retrieveEntityReq.open(“POST”, pth, false); retrieveEntityReq.setRequestHeader(“Accept”, “*/*”); retrieveEntityReq.setRequestHeader(“Content-Type”, “application/x-www-form-urlencoded”); retrieveEntityReq.send(“id=%7B” + reportGuid + “%7D&uniquename=” + Xrm.Page.context.getOrgUniqueName() + “&iscustomreport=true&reportnameonsrs=&reportName=” + reportName + “&isScheduledReport=false&p:quoteid=” + strParameterXML); var x = retrieveEntityReq.responseText.lastIndexOf(“ReportSession=”); var y = retrieveEntityReq.responseText.lastIndexOf(“ControlID=”); var ret = new Array(); ret[0] = retrieveEntityReq.responseText.substr(x + 14, 24); ret[1] = retrieveEntityReq.responseText.substr(x + 10, 32); return ret; } } The runReportToPrint() function is called when the custom button is clicked Issue and Error Details Once the environment was upgraded to V9.0 we were facing issues as the PDF that was generated was corrupted as show below. While debugging the code we got the following message. On further research we found that the URL has been changed and  below shown is the new path that has to be used which works correctly on V9.0. var pth = Xrm.Page.context.getClientUrl() + “/CRMReports/rsviewer/ReportViewer.aspx”; Once this change was done  we did not get any error and the PDF of the report that was generated opened correctly with all of  its contents.

Share Story :

Timezone effect on Work Hours

Introduction: Work Hours mentioned under a User/Bookable Resource aren’t the same as they show. Ever wondered what is Cross Day on Work Hours for a Bookable Resources in Dynamics 365 PSA or Field Service? Or even User record for that matter? And why not the actual Work Hours a resource is set to? You should see this – instead of this – Reasoning: So, The Bookable Resource’s time zone is GMT. And so is the same time zone of the logged in user i.e. GMT. In that case, you’ll see the actual time set for the user i.e. 8am to 5pm. But, let’s say, you are in a different time zone – Sydney, for example. And you are viewing Work Hours for a Bookable Resource who was set in some other time zone, their time conversion to your time will result in “crossing the day” over and hence, you see “Cross Day”.

Share Story :

Custom Business Process Flow is not showing in UCI

Posted On September 24, 2018 by Admin Posted in

Scenario: We had created the custom Business Process Flow on order entity which was visible on web client but not in UCI. For making it visible in UCI we must add that Business Process Flow in App. Steps: Create new solution and add Existing App which you are using in that solution. Add Custom Business Process Flow in App. Validate Save and Close. Publish All Customization.

Share Story :

D365 App for Outlook Sitemap Edit

Dynamics 365 application development provides an end-to-end solution for your business right from design, development, appsource listing upto enhancements and support. The team has a set of expert developers, architects and technicians who are involved 24*7 in the process to enhance your business and take it to the next level. The team understands your business needs initially and then starts working on the goals for the betterment of your business. Based on the case scenarios, applications are designed and developed that could be easily fitted and implemented on to your business model. While Dynamics 365 is taking care of your business needs through cloud, you can focus on your core business strategies, needs and allocate time to your clients making a better relationship with them for enhanced business. Introduction: In this blog we will discuss how we can add entities to the by default App for Outlook look while we track emails using App for Outlook. Steps: By default, the App for Outlook does not show any entities in its sitemap. As we all know that there is new concept of Apps in MSCRM. We can develop Apps so that we can give users a limited and required access to entities. Every module in CRM is now a app like Field Service App, Project Service App, Service App. Similarly there is App for Outlook App. Below is the default sitemap for App for Outlook. You can add Area, Sub area and groups to the default sitemap and publish the changes. Below is the screenshot after addition of required area, sub areas and groups. This is how you can change the entities visible in D365 App for outlook.

Share Story :

Forcing Fields on BPF to be required programmatically

Overview: I had a requirement where I needed to make certain fields on BPF as required. So, I tried accessing the control using Xrm.Page.getControl(“header_process_description”) and then getAttribute().setRequiredLevel(“required”) on it would serve my purpose. But actually, not! To set perspective, the code runs and make the field required too. But there’s a catch! Required fields on the BPF are supposed to throw an error when you are trying to move to the next stage without filling in the required fields. But, using the code I’m talking about above (sample shown below), will force you to save the form entirely. Let alone moving the stages further. That when ‘How Did You Hear About Us?’ field has Employee Referral as value, make Purchase Process field required. Field is on the BPF But asks you to save on the form Workaround: The easiest workaround to this is using the conditional branching of your business process flow – You can use conditional branching of the BPF itself – You can replicate the same stage twice, one having your required field and other having that same field as optional However, limitations I found with this approach is – I couldn’t use the same for the first stage of the BPF The condition had to be from the previous stage itself   P.S.: Business Rules isn’t a solution as well. Also, I tried to inverse the logic by first making the field required in the BPF itself and then trying to make it not required using code. That doesn’t work either.

Share Story :

Get Geolocation details using Xrm.Device for mobile devices

Posted On September 10, 2018 by Clinton D'Mello Posted in Tagged in

Introduction: In this blog we will use the  Xrm.Device Client API reference to get the location details as it provides methods to use native device capabilities of mobile devices. Implementation: Step 1 : First we have written a JavaScript code to get the Geolocation details and for this demonstration purpose we trigger this code to run on update of a field. We have created a custom field as Coordinates to store the details. Syntax: Xrm.Device.getCurrentPosition().then(successCallback, errorCallback) Below shown is the Code: var cordsLat = null; var cordsLong = null; var Scripting = { Location: function () { debugger; Xrm.Device.getCurrentPosition().then( function success(location) { cordsLat = location.coords.latitude; cordsLong = location.coords.longitude; Scripting.UpdateRecord(); }, function (error) { Xrm.Navigation.openAlertDialog({ text: error.message }); } ) }, UpdateRecord: function () { var id = Xrm.Page.data.entity.getId(); id = id.replace(“{“, “”); id = id.replace(“}”,””); var clientUrl = Xrm.Page.context.getClientUrl(); var req = new XMLHttpRequest(); req.open(“PATCH”, encodeURI(clientUrl + “/api/data/v9.0/accounts(” + id + “)”), 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”); var body = JSON.stringify({ “cf_cordinates”: “Latitude: ” + cordsLat + ” Longitude: ” + cordsLong, }); req.send(body); } } Step 2: One important thing to note is the Xrm.Device control is only available in for mobile devices. When we run this script on a mobile device we get an error message and it does not go after turning on the GPS location of the device. Step 3: To enable the script to work on the device navigate as shown belowOnce this is done and  the script successfully runs we have to refresh the page and the details are updated on the Coordinates field as shown below

Share Story :

Create Leads when Email is received to the Queue

Posted On September 10, 2018 by Admin Posted in

Introduction: This blog explains how to Create Leads when Email is received to the Queue. Creating Queue in MS CRM: Settings -> Service Management -> Queues Click on “+NEW” Enter Name and Incoming Email for the Queue. Save record. After Saving the record Mailbox will be created for the Queue. Configuring the Mailbox Open the Mailbox Click on Approve Email Click on Test & Enable Mailbox After Configuring Successfully, you can see Status as Success for Incoming and Outgoing Email. Create Workflow to Create Lead: Go to Settings -> Processes Create new process. Select Entity: Email Below is the Workflow: To set the regarding of email. Click on Set Properties of Update Email Step. Click on Set Properties of Create Lead Step and add details in fields. After Writing all the steps Activate the workflow.

Share Story :

SEARCH BLOGS:

[gravityform id="36" ajax="true"]

FOLLOW CLOUDFRONTS BLOG :