Category Archives: Dynamics 365
Leveraging FetchXML with Dynamics CRM
Overview: FetchXML is used to query the Dynamics 365 database. A great advantage of using FetchXML is that it can be easily designed by using Dynamics 365 database and it is easy to understand. FetchXML tester is available in the XRM Toolbox which can let you test and fetch results quickly. FetchXML also provides facilities like aggregation and grouping of data. Using FetchXML: FetchXML must conform to the fetch.xsd schema provided with the Dynamics 365 SDK under the directory SDK\Schemas\fetch.xsd FetchXML must be built into a query string which can be used with IOrganizationService.RetrieveMultiple to retrieve data from Dynamics 365. FetchXML query can be saved in Dynamics 365 by creating a SavedQuery record. From the above sample query, a query can be constructed inside <fetch></fetch> tags. In the above example, I’m retrieving Contact records with the attributes Contact ID which is the Primary Key and the Full Name of the Contact. In the above query, using count=’3’ will retrieve a maximum of 3 records. Executing the FetchXML query: You can simply use the above query in the FetchXML tester provided in the XRM Toolbox and get results or you can construct a query string and use it with IOrganizationService.RetrieveMultiple() and get results in the EntityCollection object in your application. Using the above query, here’s how I can make it into a query string and retrieve the results in my application. Then, I can use foreach() to loop through the result returned in the EntityCollection. FetchXML Aggregation: The following aggregation functions are provided in FetchXML: sum avg min max count(*) count(attribute name) Example of max used with aggregation: In the above example, I’ve used the attribute aggregate=”true” in the FetchXML header and used an aggregate aggregate=”max” with the field Employee which is count of Employees in an Account. The result returned for the same was: The above result returned a formatted value of 13000 which is the max for an Account. Also, notice that the tag is <total></total> since it was the alias I used in the query. Likewise, you can use other aggregates and grouping functions. Understanding Results of FetchXML: FetchXML results are returned in the <resultset></resultset> tags as shown in the sample below: Each record is retrieved under an individual <result></result> tags. Paging: At maximum, a FetchXML query can return not more than 5000 records. If results are more than 5000, morerecords attribute in the resultset will return “1” and will be shown like below: In order to fetch further records, you’ll need to use PagingCookie. A sample code has been provided in the SDK under SampleCode\CS\GeneralProgramming\Queries\FetchPagingWithCookie.cs to leverage the same. Also, if you want to return results with even smaller numbers, you can use paging in the FetchXML tested by using the following: In the above example, I’m choosing to show only 2 records per page and I’m retrieving page no. 2 of all the records. Hope this was helpful!
Share Story :
Retrieve data using same data type fields from different entities
Introduction: We have various methods to query CRM like, “query expression”, “fetch expression” and “LINQ”. If we want to query data of two different entities, then we should have relationship between entities otherwise you will not get data. In case you want to process data of two different entities which are not related to each other then what to do. We can achieve this using fetch Expression in with the common field data type. Description: We had a requirement where we wanted to get the data from two different entities which were not related to each other but both of them had common field Email Address. So we can query the CRM using Fetch expression by providing from field and to field which will connect to each other. Solution: To demonstrate this how it works I have tested it with account and contact entities as an example. We are testing it with “email address”. To execute this query XRM tool box is used. You can download it from given link http://www.xrmtoolbox.com/ Account: Contact: Query: <fetch version=”1.0″ output-format=”xml-platform” mapping=”logical” distinct=”true” > <entity name=”contact” > <attribute name=”fullname” /> <attribute name=”emailaddress1″ /> <order attribute=”fullname” descending=”false” /> <link-entity name=”account” from=”emailaddress1″ to=”emailaddress1″ alias=”Account” > <attribute name=”emailaddress1″ /> <attribute name=”name” /> </link-entity> </entity> </fetch> As you can see that we have linked contact and account on the basis of emailaddress1. Once you execute the query you will have all the records which are related to each other with same email id As you can see there are more records matching with same email id on account and contact. So it returns all the records with the matching email id. Conclusion: You can query CRM data of two different entities using the same data type fields.
Share Story :
Hide Custom Button on Create Form in D365
Introduction: This blog explains how to hide custom buttons on create form in D365. Problem Statement: We often get requirement from Client to hide custom buttons on Create record and to be shown on updating of record. Solution: We can achieve this functionality by having ribbon Customization with Enable Rules using FormStateRule. Steps of Implementation: 1. Create a new Command. 2. Create a new Enable Rule. 3. Create a new FormStateRule. 4. Set Enable Rule on Command. 5. Set Command on Button. Conclusion: Below image confirms button is hidden on Create Record and it is shown on Update Record. Create Record: Update Record:
Share Story :
Using Real time workflows for Business Validations in Dynamics CRM
Introduction: Like asynchronous workflows, real-time workflows can be used to model and automate real world business processes. Real-time workflows are for business users, for example business analysts, to implement similar functionality to synchronous plug-ins without requiring .NET Framework programming experience. How to use Real time Workflows for Custom Business Validations: Real time workflows can be used to not only implement business logic in Dynamics, but also simple and complex validations in the business flow. Let us understand this using 2 examples: Example 1: We have a business Validation that leads with employee size less than 100 should not be allowed to qualify. Earlier, we used to do this either from JS form scripting or using Plugin. But we can also use Real time workflow to achieve this, and it can throw a validation message as well to user. 1. For it to throw a validation message, we need to stop the workflow and select reason as cancelled. Then we can set the status reason as the message we want to display the user. 2. This is what the User will see if he/ she tries to qualify a lead with employee size less than 100. 3. This is the workflow that we configured: 4. You can specify the validation message in the Stop Workflow properties. Please note that Status of “Stop Workflow” should be cancelled for users to see the message. Example 2: We can have more complex validations as well using Real time workflow. 1. For example, Lets say we don’t want the opportunity to be Won unless the Account (Customer) has Credit limit greater than the Opportunity Budget Amount. We can configure this condition as well in Workflow. Refer Screenshot below: 2. And the End user will see the error message as below when he/ she tries to mark the opportunity as Won when the customer’s credit limit is less than the Opportunity Budget. Conclusion: Real time workflows are very powerful, and can be leveraged to perform server side validations in Dynamics CRM, along with real time CRUD operations and Email messages.
Share Story :
Creating Entity Lists OData Feed Using Custom JavaScript in CRM Portals
Introduction: In this blog, we shall see how can a user create an Entity List OData Feed using custom JavaScript in CRM Portals. Pre-Requisites: D365 CRM Portals D365 CRM Environment Why Use OData (Open Data) Protocol? OData provides external access to a data source via a website. Recommended for the Open Government Data Initiative. Data API for Microsoft Azure Data is delivered in JSON format unlike XML format. Use of OData for custom live reports, new feeds, external applications, or leveraged by client-side AJAX for unique Entity List UI. Scenario: In the following scenario the user will learn how to configure an Entity List OData Feed and Configure OData Display Using Client-Side JavaScript. The following below image shows the OData feed from an Account Entity List, that we are going to create using client-side JavaScript. Fig 1. The OData to be configured using client-side JavaScript Steps for Implementing Above Scenario Step 1: The user will have to first create a new ‘Entity List’ in this case a ‘Account’ Entity List by going to Portals>Entity List and click on ‘New’ and in the Entity Name input select ‘Account’ and create a view Name “Active Accounts” that will display a grid view of all the Active Accounts as shown below in the following two images. Fig 2.1 Creating a New Entity List Fig 2.2 Setting Properties for the Entity List Now, user will have to enable the Entity List for OData Feed by checking on the ‘Enable’ option and entering the details into the input fields in the OData Feed Section for the Entity List as shown below: Fig 2.3 Setting Properties of OData Feed for the Entity List Step 2: The user will have to create a Page on the CRM Portals to display the following Entity List. The user will have to use the Admin panel and click on ‘Child Page’ to create a new Page which will display the Entity List after setting the properties of the page as shown below. Fig 3.1 Setting Properties for the Portal Page that will display the Entity List Fig 3.2 Setting up the Account Entity List Page Step 3: The user will now have to obtain the OData Feed by entering ‘/_odata’ to the end of the Portal URL that the user uses to open the CRM Portals which will open a XML page as shown below. Fig 4.1 OData URL of the CRM Portal Note: The user will have to save the odata xml format and open it in another application like ‘Notepad’. Fig 4.2 XML Format of the OData Feed on CRM Portals Now in the above XML format we can see that accounts is being used as the href. To obtain the JSON format of the OData Feed the user will have to add the href used in the XML format to the end of the previously seen OData URL which is shown below. Fig 4.3 URL to obtain JSON format of the OData Feed Fig 4.4 JSON Format of the OData Feed on CRM Portals Note: The user will obtain a URL to the bottom of the JSON Format of the OData Feed which will provide the user to go to next set of records for the Entity List Step 4: Once the user has obtained the OData Feed the user will have to render the following OData Feed with a unique UI provided by ajax JavaScript on the client Side. The following is the Custom JavaScript containing the ajax call function against the OData Feed as shown below. Fig 5.1 Custom JavaScript to display OData Feed on CRM Portal Page The user will have to paste the code into the source code of the CRM Portal Page as shown below to which he wants to display the OData Feed as shown previously in the Scenario above and click on Save as shown below. Fig 5.2 Pasting the JavaScript into the Source Code Conclusion: In this way the user can implement a simple Entity List OData Feed on CRM Portals using a client side custom JavaScript.
Share Story :
Advantages to Managing your Sales Pipeline in CRM
Overview: The purpose of this article is to help fellow entrepreneurs and sales managers leverage technology for effectively managing their sales pipeline with a few easy steps. As an entrepreneur, one of the most difficult aspects of my work is generating sales and building a healthy sales pipeline. On June 1st 2017, CloudFronts will complete 5 years and looking at all the systems we have in place, I feel we have adequate sophistication in our Operations and Administration processes. On the other hand, I feel our Sales processes are still not mature and need to evolve. This and future articles will focus on how we can leverage Microsoft Dynamics 365 for Sales for managing sales. This is something we use today and so I feel it should help others. “I know I need to keep track of my sales pipeline, but I am just so busy.” Step 1 – Data Entry We are always so busy and entering data into CRM can be such a pain! Just quickly sending out that email makes sense when you have just a few opportunities to manage. Eventually this method fails as our memory can only hold so much information. So, you will need to enter data in your CRM! While the term, ‘garbage in, garbage out’ applies to data, this is apt for a sales person – “No data entry = lost opportunities”. So, take a few seconds (now is the best time) and enter that Customer, Contact and Opportunity data into CRM! You already paid for the licenses, might as well use it! Step 2 – Managing your pipeline by keeping your ‘Est. Close Date’ up-to-date. Once I enter my Opportunity for the first time, I just really want to update the Est. Close Date and sometimes the Est. Revenue. I really do not want to open the Opportunity every time. I could have used Editable Grids for this but I also wanted to add some ‘intelligence’ here which I could use later for analysis. I wanted to capture some notes on why I changed the Est. Close Date and put these notes in the Notes section with a predefined title (like – ‘Est. Close Date Change Reason’). I worked with our CRM team to setup a simple workflow dialog. This is how I manage my Opportunities now – 1. My Open Opportunities View> Select my Opportunity and then run my Dialog. The dialog is simple and really has only 2 input options, Est. Close Date and Reason – The reason becomes a note record on my opportunity. The above process works well for me for my Pipeline Management. My opportunity view is sorted by Est. Close Date, so this further ensures I do not have any past due opportunities. Step 3 – Just do it. No, we don’t need to really buy a pair of running shoes, but we need to do the above 2 steps diligently and every day. The benefits of this exercise will become obvious very soon and you will be running faster than before towards better close rates as things stop falling through the cracks (of our brain). Remember – ‘Sales cures all.’ Let’s take care of that sales pipeline! You can always email me at AShah@CloudFronts.com to discuss your sales processes and technology adoption. In the coming articles, I will talk about how Sales Pipeline Management ties into business decision making – from Resource Allocation to Recruitment.
Share Story :
Set Party List field using JavaScript in Dynamics CRM
Introduction: In this blog, we are going to discuss how to set a party list field using JavaScript in Dynamics CRM. Many times, there is a requirement that any email send from CRM must be send from a specific user, irrespective of the user logged in to CRM. Scenario: In the Incident Management, there is a need that each mail send from CRM to Customers must be send from Support User. Steps: Step 1: Write a function on load of email form. Retrieve the Queue or User you want to set from Web API Step 2: Party List basically consists of User or a Queue. So, we can set User or a Queue in party list. You can differentiate the User and Queue by specifying the Entity Type. a. Queue: “queue” b. User: “systemuser” Code is given below: var partylistData = new Array(); partylistData[0] = new Object(); partylistData[0].id = queue.value[0].queueid; partylistData[0].name = queue.value[0].name; partylistData[0].entityType = “queue”; Xrm.Page.getAttribute(“from”).setValue(partylistData); More validation can be set on basis of the requirements. On the status of the email validation can be done.
Share Story :
Deploy Package in Dynamics 365 Operations Environment
As an entrepreneur, if you want to streamline your operations and finance departments, you should go for an ERP solution. Countless companies are offering ERP or Enterprise Resource Planning solutions or software. Dynamics 365 for finance and operations, however, is one of the best ERP solutions that you can find in the market today. One of the key reasons why a lot of companies are using this software is that it is easy to install, configure, and to use. You can scale your business when you use ERP solutions like Dynamics 365. A lot of resources are available online that will help your employees become smart and efficient. Deploying this software is easy. Here is some information for you In this blog article, we will see how we can deploy the package in Dynamics 365 Operations. This Package can be any latest update, hotfix or deployment package you have created. Prerequisites: LCS login VM Instance Steps: 1. Download, Extract and Unblock Package 2. Update topology configuration data 3. Generate a runbook from the topology 4. Execute runbook Download, Extract and Unblock Package a. Login to LCS and download the Zip file of Deployable Package. b. After downloading, go to downloaded Zip file properties and select unblock. c. Extract the Zip file to a non–user folder. Update topology configuration data a. Go to extracted folder and open the file “DefaultTopologyData.xml” b. Populate the file with VM name. i. Go to This PC -> Properties. Find the name of the machine. ii. Update the VM name with the machine name in the file. c. Populate the file with installed components i. Open a command prompt as an administrator. ii. Run the command from extracted folder path to see a list of all installed components on the computer. iii. Update the file with a list of components. 3. Generate a runbook from the topology a. Run the command to generate a runbook. AXUpdateInstaller.exe generate -runbookid=[runbookID] -topologyfile=[topologyFile] -servicemodelfile=[serviceModelFile] -runbookfile=[runbookFile] Example: b. Runbook will contain instructions in sequential steps to deploy the package. 4. Execute Runbook a. Import the runbook. AXUpdateInstaller.exe import -runbookfile=[runbookFile] Example: b. Verify the runbook. c. Execute the runbook. AXUpdateInstaller.exe execute -runbookid=[runbookID] Example: d. Export the runbook. Export the runbook for future reference, you can use it to refer the steps, time to execute each step and logs for each step. UpdateInstaller.exe export -runbookid=[runbookID] -runbookfile=[runbookFile] Example:
Share Story :
Dynamics 365 Retail Store CPOS Configurations
Microsoft Dynamics 365 for Retail Management Solution is the perfect answer to the questions from the modern day consumers related to cost-effectiveness, fast and flexible services that they aim for. Microsoft Dynamics aims at seamless management solutions across all retail channels making it easier for the customer to establish a balance between their business requirements and the deliverables. When it comes to power and performance, Microsoft Dynamics is the best enterprise resource planning (ERP) cloud solution currently available in the market This amazing retail management solution from Microsoft has considerably reduced the complexities faced by the retailers in their day-to-day life in a new and unified way making it one of the most wanted and demanded software solutions in the market. Introduction: Dynamics 365 Operation Retail is providing CPOS. This Blog Describe you, how to configure CPOS in AX 7 Operation. CPOS is Online POS, Offline POS functionality does not support to CPOS. CPOS can be Open in Internet Explorer, chrome, Firefox browser. MPOS having Online and offline functionality. In this blog for Demo Purpose, we are configuring CPOS for Huston store. And for CPOS, I am using Chrome browser. Follow the Below Setup to Configure CPOS . Before you Start: Before you Start Configuration of CPOS. Go to the Retail and Commerce -> Headquarter setup -> Parameter -> Retail Shared Parameters Select Entity Validation Templates. Click on Import Default template. After that Drill-down to template Option and select Select RetailVal and click on SAVE button. Step 1: Go to the Retail and Commerce > Channels > Retail Store > All Store And select Houston Store. Click on Configuration Status. Select Approve All and click on Update Button. Step 2: Go to Retail and Commerce > Channels > Channel Deployment In Retail Store search for Houston Store. You will find that Progress for Houston store is 100%. Step 3: Click on Registers. Next to that you will see all the register which is created all stores. Put the filter on “HOUSTON” on Store Number. After that you can able to view list Houston Store Registers. Select Registers Number “Houston-30” and Open it. Click on configuration Status Click on Approve all and click on Update. Once you click on Update. Status will change to Completed. Click on close button. Step 4: On register page click on Device Select “HOUSTON-30”. Application Type of this Device is “Retail Cloud POS”. which mean this is CPOS. Activation status is Pending and Validation Status is not Run. Change Activation Status from pending to Pending to Activated and click on Validate Devices for Activation. Step 5: In General Tab of Device “Houstone-30” copy POS URL and Past it in Browser. Or you can click on that URL Link. Click on Next Button. Server URL, Device ID and Register ID is set by Default base on your Cloud POS Device. Click on Activate button. Once you click on Activate, it will start for activating Cloud POS. Once its Active, you will get message Click on Get Stated. You can able to view Cloud POS Login Screen. Enter Worker user ID and Password to login. Conclusion: By following this Steps, you can configure CPOS in Dynamics 365 Operation.
Share Story :
CRM Data Migration tool
Introduction: CRM SDK provides a data migration tool/application called “DataMigrationUtility” which allows simple data migration from one CRM environment to another CRM environment. Prerequisite: Microsoft Dynamics CRM. CRM SDK Purpose of the set up Our goal is to migrate accounts from one Online CRM environment to another CRM environment. Steps: Open CRM SDK folder and run ‘DataMigrationUtility’ application. Path: SDK\Tools\ConfigurationMigration Click on Create Schema. You’ll be asked to log in to your source CRM system. Select the solution, entity and fields. Then click ‘save and export’, this will save a XML schema file. To export data: select XML file created in the above steps and create a file to save the data (zip file); then click Exportdata. Click exit after successful export of data. To import data: Click on Import data and then continue. Login to your target system. Select Zip file which was created in the above steps. Click on Import data Error logs can be viewed from Logs stored.
