Latest Microsoft Dynamics 365 Blogs | CloudFronts - Page 4

A Duplicate Lookup Reference

Introduction: Best way to load data into CRM is excel/CSV.  But some time it happens that few records may not be imported into CRM. One of the error more frequently occurs is “a duplicate lookup reference was found”. Description: If you are importing data using CSV, you will find that this is simplest way of importing data into the CRM. But there are chances that while importing data you may receive error. One of them is “a duplicate lookup reference was found” looking at the error it says that you have more than 1 records with the same name while setting the look up. But if you will try to look for the duplicate record you would not be able to find record. As you can see in the below screen shot. It has two fields with the same display name, so if you will try to import the records in the CRM.  You will encounter the listed error. To resolve reported error, you need make sure that you have unique display name. Hope this blog helps you to import the records while importing the records.

Share Story :

Azure Function

Introduction: Sometime it happens that you want to write small piece of code and it should be accessible from outside but you may not have infrastructure ready for it. In that situation you can write a function which can be called from anywhere. Azure function provides required infrastructure for code you need to write and you can make it available within few minutes. You can use Azure functions where you code does not include any complex logic. Azure functions can be used for very small pieces of code which can be invoked via any triggered events. You can choose your language to write the code like C#, F#, Node.js, Python or PHP. Azure Functions lets you develop server less applications on Microsoft Azure. Description: 1. Features: Azure function provides the below features: Choice of language – We can write functions using C#, F#, Node.js, Python, PHP, batch, bash, or any executable. Pay-per-use pricing model – Pay only for the time spent running your code. Bring your own dependencies – we can include other library as well if needed. Integrated security – Protect HTTP-triggered functions with OAuth providers such as Azure Active Directory, Facebook, Google, Twitter, and Microsoft Account. Simplified integration – Easily leverage Azure services and software-as-a-service (SaaS) offerings. Flexible development – Code your functions right in the portal or set up continuous integration and deploy your code through GitHub, Visual Studio Team Services. 2. Function Task: Functions provides templates to get you started with key scenarios, Blob Trigger EventHubTrigger Generic webhook GitHub webhook HTTPTrigger QueueTrigger ServiceBusQueueTrigger ServiceBusTopicTrigger TimerTrigger Create your first function: Prerequisites: Windows Azure Subscription – you can also subscribe for a free trial of Windows Azure from URL. Add Function Apps In order to host your code, you must have a function app created in the Azure. Login to the azure portal and click on the +(plus) sign Select the function app and provide the required details Provide the Azure function details as shown below. Provide all the required field value and click create, you will able to see below screen, Create function: Click on the plus sign as shown Select the httptriger-csharp Provide a unique name to the function and click create Now you are read with the function that can be access from anywhere. This is the template you can write your own code, we will work with the sample code that generated automatically. Let’s test the function from outside. Copy the url form the console as show You will get the code url that can be called from any API tester application, lets we called it from the Postman application. As you can see in the below screen, I called the function from Postman and in out window you will find that it is showing message. It shows some validation message because I have not provided the required fields. I provided the name you will find that output shows the name with greeting. View the function logs Conclusion: So, it concludes that we can have small piece of code that can be called form outside and we don’t require to maintain the infrastructure.

Share Story :

Ribbon Customization

Posted On May 25, 2017 by Subhash Mahato Posted in

Introduction: While customizing or adding a button to ribbon there are chances that you want to add same behaviour as of an existing button. But it is not known how to check what logic has been applied to that button. Description: If you want a custom button to have same behavior as that of system button, then how to achieve this. This can be achieved by using the workbench Ribbon customization tool. Let’s see how to do that. Open Ribbon Workbench and select the solution which you want to customize. Here I want my custom button to have same behaviors as of the Qualify lead Right click on the Qualify button and select customize command. As soon as click on the customize button you will able to see all the customization that are applied on that button as show below. Now you can add all the display and enable rule to your command as shown below. Similarly, you can add display rule as show below. Now you have same customization as that of the lead button.  

Share Story :

Increase number of Tab and Fields on tables

Introduction: The tablet app for Dynamics CRM have limits that allows only number of fields, tab and grid that can be view on form. The current limitation are as below, 75 fields 10 Grids 5 Tabs Description: This limitation is put to increase the performance of CRM while using on phone or tables but what If you are using CRM online and you have more than 75 fields on the form than you will not be able to see the fields which falls after that on tablets. Similarly, if you have more than 5 tabs than you will able see only first 5 tab in the tablets. Solution: CRM includes organization settings that can increase these limits. These changes cannot be done directly. You can change these settings using the OrgDBOrgSettings tool, available with any update rollup download. You can download the tool from given link: https://orgdborgsettings.codeplex.com/ You need to import the managed solution into the CRM and Once the import is successful you will able to see the solution. Open the solution and you will able to see the organization setting cannot be changes directly We will change the setting for the for the tablet setting as shown below You can change the setting as below Max fields =500 Max grids=50 Tabs=50 Hope this helps, while designing tablets forms  

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 :

Invalid Namespace Error

Introduction: We have an integration of CRM with 3 party system which sends sales data. We used the Azure service bus to send data from CRM to 3 party system in real-time. It was working fine until CRM 2016 But after the upgrade of Dynamics CRM to Dynamics 365, our integration stopped. Description: We decided to check why our integration has stopped so, we checked the system log and we found there is some issue with service connection. After diagnosis of error we try to update the Azure service bus but we were not able to update the service end point. We continuously receiving the same error “Invalid Namespace” So we tried another approach and decided to create new service end point. I have followed the below steps for registration. Register a new Service Endpoint Add the connection string from Service Bus portal. Select the Designation Type as “Two way” The error occurs “Provide a valid Namespace Address” while saving it. Solution: We connected with Microsoft and they suggested that there is a slight modification in the Namespace Address. To resolve this issue you need to change Namespace Address from sb:// to https:// Example: sb://xxx.servicebus.windows.net/abc/xyz -> https://xxx.servicebus.windows.net/abc/xyz Conclusion: Sometimes unknown minor issues will stop your whole integration process and it will be not known to you. Hope this blog helps you resolve your service bus integration issue.

Share Story :

Enterprise Integration with Azure Logic Apps

Understand Enterprise Integration Pack (EIP) The Enterprise Integration Pack is Microsoft’s cloud-based solution for seamlessly enabling Business-to-Business (B2B) communications. EIP is new features in Logic Apps which adds B2B and XML capabilities. Enterprise Integration Pack brings some of the enterprise B2B capabilities like AS2 and X12, EDI standards support (with EDIFACT coming shortly) and new set of XML capabilities like XML Validation, XSLT Transformation and Flat file to XML encode/decode. Why should you use Enterprise Integration? You can keep all your artifacts at one place like partner, schema, mapping. i.e.  Integration Account. You can simply use all the connectors available to build B2B workflows and integration with 3rd Party SaaS applications. You can also test the Azure functions. Enterprise Integration supported standard Enterprise Integration supports these industry standards: EDI – Electronic Data Interchange EAI – Enterprise Application Integration Minimum Requirement An Azure subscription with an integration account Visual Studio 2015 to create maps and schemas Microsoft Azure Logic Apps Enterprise Integration Tools for Visual Studio 2015 2.0 You can refer this link to understand in the details. Entities Involved in the Enterprise Integration Enterprise Integration Architecture Integration account An integration account is an Azure Account which allows to store all the artifacts required to run the Enterprise Integration for example, schema, mapping, partner agreements, certificates. You need to include this integration account while developing the logic otherwise you will not be able to use the Enterprise Integration features To understand in the details, you need to refer here. Partner  Partner is the entity that takes part in the integration process for which the data exchange process works. Before creating a partner participating organization needs to agree to share the information which will help both identify and validate messages that are sent by each other. Partners are used to create agreements. An agreement defines the details about the messages that will be exchanged between partners There must be two partners and one of them must be your own organization. The partner which represents your organization is known as host partner and the second partner is known as the guest partner. The guest partner can be another company, or even a department within your own organization. For more information on the partner and how to create a partner, you can refer this link. Agreements Agreements allows to communicate using the industry standard protocols. It makes is easy for different organization to send the data in the know format which improves the efficiency of data exchange. It is very easy to create and manage the agreements. The standard protocols that are used to Enterprise Integration AS2 X12 EDIFACT For more information on the partner and how to create a partner, you can refer the below link: https://docs.microsoft.com/en-us/azure/app-service-logic/app-service-logic-enterprise-integration-agreements Data Manipulation and Editing Schemas Many times it happens that while sending the data from one system to another the data format for both the system may differ. In that case, you may not be able to process the data on the target system. In that case you can create a schema which will validate the data structure received from the source system. To learn, how to create a schema you can refer the this link. Maps Map is a XML documents which transfers the document from one format to another format. Let’s assume that you are sending data from SalesForce to Dynamics 365. The two systems have different formats of data structures of date ‘DDMMYYYY’ and you want that to be in ‘MMDDYYYY’, then you can use the map to format the data. You can refer this link to understand the maps. XML message validation In B2B scenarios, the partners are need to have agreement to validate the XML message(s). In Enterprise Integration, you can validate the XML using the predefined XML schema XML transform XML transform provides the ability to convert an XML message based on the requirements of a destination endpoint. Other Terminology AS2 AS2 (Applicability Statement 2) is a specification about how to transport data securely and reliably over the Internet. Security is achieved by using digital certificates and encryption. MDN The Message Disposition Notification (MDN) is the acknowledgment sent in response to an AS2 message. If an MDN is enabled, the AS2 transmission is not complete until the MDN has been received and verified. BizTalk Server will always attempt to return an MDN to indicate the status of message processing, even if an error occurred in processing the AS2 message. Features and use cases The AS2 and X12 decode and encode actions allow you to receive data from and send data to trading partners using industry standard protocols using Logic apps. You can use AS2 and X12 with or without each other to exchange data with trading partners as required. The B2B actions make it easy to create partners and agreements in the Integration Account and consume them in a Logic app. By extending your Logic app with other actions you can send and receive data to and from other applications and services such as SalesForce. Sample code You can refer the below link for the AS2 send and receive, this sample code uses the AS2 technology the exchange the message: https://github.com/Azure/azure-quickstart-templates/tree/master/201-logic-app-as2-send-receive You can use the below sample code the use the schema and map validation: https://github.com/Azure/azure-quickstart-templates/tree/master/201-logic-app-veter-pipeline  

Share Story :

Modular Business apps, App Designer and Sitemap Designer

Before the introduction of Business Apps, Designer and Sitemap designer, we have to take care of following things: We have to manage the security role of users otherwise they will be able to access all the records. If a user wants to design the site map, then user needs to either edit the site map XML or use the third party application to edit it. Introduction: After reading this blog user will able to design their own app with the required component. Description: A new app designer that lets you quickly create simple (single entity) or complex (multi-entity) modular apps. The app designer, which is a tile-based information structure, makes the process of designing apps much simpler because of its intuitive interface. You can simply pick the required set of components such as form, views, dashboard, charts and process flows. Privileges Make sure that you have the System Administrator or System Customizer security role or equivalent permissions Any user with the following privileges can also access the apps: Create, Read, and Write privileges on the App entity Read and Write privileges on the Customizations entity Read privileges on the Solution entity Create an App If you want to create a new app you need to navigate to the below path Go to Settings> My Apps, and then click Create New App. Under My Apps you will able to see all the apps you have. Click on Create App Provide the app details as show below and save the app. Name Unique Name Description Icon App URL And more fields Define Site Map As soon as you will create an app, you’ll need to first define the site map. You can add the below components in the site map Area Group Sub Area You can either add the below components directly by clicking on the + sign or simply by dragging and dropping. You can also put the components by dragging and dropping Below are the components that can be added to the Sub Area Dashboard Entity Web Resource URL Here, I have added the Contact entity and a Dashboard Once you have added all the components, you need save the site map and close it. You can also see the status of your app as to whether it available to other user or not.  If the status of an app is Published, then user with the proper role can see but if it is in Draft then only it is available in Edit area. App being edited App designer: You need to specify the components that user must be able to see under the site map. You can add the below components in app designer Dashboard Entity Entity form Entity views Business process flows If you would not specify the above components, then it will add all the above components by default. You can see the below app designer after adding your form, views Validate You need to validate if we need to add any component(s) that are missing. You need to click on the Validate. If there is any issue you will be able to see the as a notification. Publish Once your issue is resolve you can publish your app Once it is published the status of your change to published. App permission: App runs on the base of security role if the current logged in user does not have same role as that of app that then he will not be able to access the app. As in CRM Once it has been published, you will see your app in the Dynamics 365 You can see this app in the CRM as show It shows only the component(s) that we have added during the app design. Now you know about Modular business apps, the App Designer and the Sitemap Designer. You can start using this functionality!      

Share Story :

PowerApps

What is PowerApps? PowerApps is a Microsoft product which allows developer/non-developer to build an application without writing a single line of code. PowerApps creates custom business apps for web and mobile devices that help you do your job more efficiently and collaborate better with your co-workers. Use PowerApps to solve problems specific to your business and extend the software you’re already using such as apps for custom site inspections, cost estimators, budget tracking, or managing customer opportunities You can use PowerApps in any web browser, including the mobile web. You can also download PowerApps Mobile for iOSor Android to use apps on your phone or tablet. No matter where you’re working, just open PowerApps to find the apps available to you. What data sources can my apps connect to? PowerApps connects to a range of data sources out of the box, and Microsoft adding more all the time. Some examples of data sources and services include: Excel files stored on OneDrive for Business, Dropbox, or Google Drive SharePoint Online lists Salesforce objects Microsoft Dynamics CRM Online records Azure SQL Database tables Office 365 Exchange data Twitter Microsoft Translator Your own custom APIs And many more applications. What’s a work or school account, and why do I need one to use PowerApps? Because PowerApps is built for business apps that you share with your team, we require you to use an email address associated with an organization (your work or school account) to sign up. Shared email providers like Hotmail or Gmail won’t currently work with PowerApps. Who can I share apps with You can share apps with anyone in your organization, that is, anyone who has your same email domain—for instance, anyemployee@contoso.com. Anyone who uses your apps will also need access to any data sources those apps connect to. For example, if you build an app that uses an Excel file on OneDrive, people you share the app with will also need to have access to the Excel file in order to fully use the app Connection: Go to: https://powerapps.microsoft.com/ You need to sign in the powerApps portal using the given link and signin/singup Once you are logged in successfully, you can create a new app from the portal. Click on create new App. You can develop PowerApps either on desktop application or on the browser, you can download it from the Store or you can directly edit in browser. Once you have installed the PoweApps from the Store now you can develop your own application by click on the new button. Select from the existing app which is a predefined template Establish your connection with CRM: If you have already connected with the existing CRM than you don’t required to connect. If your login for the first time you need provide the connection details. Click on the Dynamics CRM Online. To design the PowerApps you need to select a table from the available list, select the table(entity) Once you have done with your app is ready and you are able to see the app with 3 different type of forms. Design app BrowseScreen1:shows a list of all items and some information about them so that users can easily browse for the item they want. DetailScreen1:shows all information about a single item. EditScreen1:provides an Edit form control for adding an item or updating information about an item. Page Search and sort the contact User can search for one or more records, sort the list of records in ascending or descending order, or both. Form Type Display Screen: You can add the records from the right side pane. this only displays the records. Edit screen: Here user can change the value of a record. Update: Controls Formula: Looking value from other data set from the other data set LookUp(Accounts, accountid=ThisItem._parentcustomerid_value).name Table– Required. Table to search. Formula– Required. This formula is evaluated for each record of the table, and the first record that results in true is returned. You can reference columns within the table. ReductionFormula– Optional. This formula is evaluated over the record that was found, reducing the record to a single value. You can reference columns within the table. If this parameter is not supplied, the function returns the full record from the table. Update = DataCardValue9.Text; Search(Contacts, TextSearchBox1.Text, “firstname”, “_defaultpricelevelid_value”, “_ownerid_type”, “_ownerid_value”) Table – Required. Table to search. SearchString – Required. The string to search for. If blank or an empty string, all records are returned. Column(s) – Required. The names of columns within Table to search. Columns to search must contain text. Column names must be strings and enclosed in double quotes. If SearchString is found within the data of any of these columns as a partial match, the full record will be returned. SortByColumns( Contacts, ” firstname “, SortOrder.Descending ) Bind data to Dropdown Table – Required. Table to sort. ColumnName(s) – Required. The column names to sort on, as strings. SortOrder(s) – Optional. SortOrder!Ascending or SortOrder!Descending. SortOrder!Ascendingis the default. If multiple ColumnNames are supplied, all but the last column must include aSortOrder. SortByColumns(Search(Contacts, TextSearchBox1.Text, “firstname”, “_defaultpricelevelid_value”, “_ownerid_type”, “_ownerid_value”), “_defaultpricelevelid_type”, If(SortDescending1, Descending, Ascending)) Reference Link 1. https://powerapps.microsoft.com/en-us/tutorials/getting-started/ 2. https://powerapps.microsoft.com/en-us/tutorials/formula-reference/ 3. https://powerapps.microsoft.com/en-us/tutorials/working-with-cards/  

Share Story :

How to Read/Write data from Azure service bus Topics/MSMQ

We had a requirement where one of our client wanted to perform the below operation. Data will read from the Azure service bus and will be written to windows MSMQ. Similarly, Data will read from windows MSMQ and will be written to Azure service bus. Introduction Client had a third party solution which used to send the data from portal to Dynamics AX, they did not have direct way to send the data to AX, so they did some custom development and used a worker role to send the data to AX. Similarly, they were sending back data to the custom portal. So, they wanted to use the scribe Insight to integrate the two system instead of the worker Role deployed by tem. Description As we know that the data is present in Azure Service Bus Topic from the third Party Application. We can implement the logic and send the data to the Scribe in Queue. Azure Service Bus (Topic) -> Microsoft MSMQ If you want to send the data form Azure service bus Topic, please follow the steps. Read the data from the Azure service bus and write to the Microsoft MSMQ (Scribe Insight Queue) You need to have connection string of the service bus. Topic Name. Subscription Name. MSMQ name. You can use the below code to read the data from Azure service bus Topic private void ReadTopic() { string connectionString = “Endpoint=sb://sample.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=d7wsaddYK1unQjy1WiIdX/4t8M+vtFZPKDluMSzelFpGdadsad=”; SubscriptionClient Client = SubscriptionClient.CreateFromConnectionString(connectionString, “topic”, “subscription”); // Configure the callback options. OnMessageOptions options = new OnMessageOptions(); options.AutoComplete = false; options.AutoRenewTimeout = TimeSpan.FromMinutes(1); Client.OnMessage((message) => { try { // Process message from subscription. eventLog.WriteEntry(“Processing data”); var bodyJsona = new StreamReader(message.GetBody<Stream>(), Encoding.UTF8).ReadToEnd(); bodyJson = @bodyJsona; var document = JsonConvert.DeserializeXmlNode(bodyJson, Constants.ROOT); eventLog.WriteEntry(Constants.MESSAGEID + message.MessageId); MessageQueue rmTxnQ = new MessageQueue(FormatName:Direct=OS:” + MachineName + “\\private$\\scribein ); rmTxnQ.DefaultPropertiesToSend.Recoverable = true; rmTxnQ.Send(document, MessageQueueTransactionType.Automatic); message.Complete(); } catch (Exception) { // Indicates a problem, unlock message in subscription. message.Abandon(); } }, options); } The Above function will keep listening and if there is any data coming to specified topic/subscription it will read the data and write to the specified queue. Once that data is in MSMQ you can read and pass the data to AX system since the connector is available in Scribe Insight. Microsoft MSMQ -> Azure Service Bus (Topic) Read the data from the Microsoft MSMQ (AzureOut Queue) and write to the Azure service bus. You need to have connection string of the service bus. You can use the below code to read the data from MSMQ. Since there is no listener, so if there is any data coming to the MSMQ (AzureOut) it will not process immediately if any record processed to the queue. You can use the below function to read data form the MSMQ You need to have connection string of the service bus. Topic Name Subscription Name MSMQ name private void ReceiveMessageFromQueue( ) { MessageQueue messageQueue = null; Message[] messages = null; XmlDocument doc = null; ////XDocument input = null; string dataFormatedJson = string.Empty; string messageTopicName = string.Empty; string connectionString = “Endpoint=sb://sample.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=d7wsaddYK1unQjy1WiIdX/4t8M+vtFZPKDluMSzelFpGdadsad=”; string topicName = “topic”; try { messageQueue = new MessageQueue(“FormatName:Direct=OS:” + MachineName + “\\private$\\azureout”, false); messages = messageQueue.GetAllMessages(); foreach (Message msmqMessage in messages) { Message message = messageQueue.Receive(); messageTopicName = message.Label; message.Formatter = new XmlMessageFormatter(new string[] { “System.String” }); byte[] b = new byte[message.BodyStream.Length]; message.BodyStream.Read(b, 0, (int)message.BodyStream.Length); System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding(); var returnVal = enc.GetString(b); doc = new XmlDocument(); doc.LoadXml(returnVal); ////input = XDocument.Parse(returnVal); dataFormatedJson = JsonConvert.SerializeXmlNode(doc); TopicClient client = null; try { client = TopicClient.CreateFromConnectionString(connectionString, topicName); client.Send(new BrokeredMessage(formattedData)); client.Close(); } catch (Exception ex) { this.eventLog.WriteEntry(“Message: ” + ex.Message + “Trace: ” + ex.StackTrace + “Data: ” + formattedData); } } } catch (MessageQueueException ex) { this.eventLog.WriteEntry(“Message: ” + ex.Message + “Trace: ” + ex.StackTrace + “Data: ” + dataFormatedJson); } catch (Exception ex) { this.eventLog.WriteEntry(“Message: ” + ex.Message + “Trace: ” + ex.StackTrace + “Data: ” + dataFormatedJson); } finally { messageQueue.Close(); } } Using above two function you can read and write the data from Azure service bus Topic to MSMSQ and similarly you write the data back to the Azure Service Bus Topic from MSMQ. Hope this help you to understand how to send and receive the data from Azure Service Bus Topic and vice versa.  

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange