Dynamics 365 Archives - Page 35 of 89 - - Page 35

Category Archives: Dynamics 365

Calculated Field in Dynamic 365 CE

Introduction In this blog we will see how to use Calculated field. Use Case : Its common requirement of Project to set calculated date to specific date field by adding or Subtracting the no. of days. Implementation : Step 1: Let say we have date field in an Account Entity.   Step 2:  Create one more date field with data type as date with field type as calculated field. Select field type -> Calculated -> Edit Step 3: Click on Edit. and add condition. In this scenario , I want to add 3 days to the  selected date which is date created field. So the condition is if current entity date created field contains data And then add action. Save and close Result :

Share Story :

Order fulfillment notifications in Dynamics 365 Retail (Commerce)

Posted On December 27, 2019 by Admin Posted in

The order fulfillment operation in the point of sale provides a single work area in the point of sale that can be used to process orders. This includes everything from accepting the order, to marking it as shipped, or initiating store pickup. In my case we wanted a notification to appear on POS whenever a customer order is created. This is useful in a situation where the goods are stored in the store room and you want the store room person to be notified about a new order creation. This will enable him to start preparing the goods as soon as the order is created in POS. Which will be picked up by the customer later. For this to work, the front desk store worker and and the store room worker both need to have POS registers. The following setup needs to be done at HQ to enable this functionality Add order fulfillment button on POS, Enable live content on button Enable notifications for an operation  Set up a notification interval Update the POS permission1.  Add order fulfillment button on POS, Enable live content on button 2.  Enable notifications for an operation Go to Retail > Channel setup > POS setup > POS > Operations. Search for the Order fulfillment operation, and select the Enable notifications 3. Set up a notification interval Go to Retail > Channel setup > POS setup > POS profiles > Functionality profiles. In the Notification interval field, specify how often notifications should be pulled. 4. Update the POS permission Go to Retail > Employees > Workers >, under Retail tab, open the POS permissions associated with the worker. Expand the Notifications FastTab, add the Order fulfillment operation, and set the Display order field to 1. After the setup please run staff and and channel configuration jobs and you are all set. Activate/relaunch the POS On POS create a customer order and select Pick up from store option. Once the order has been created, it would appear in the notification window depending on the refresh interval Now click on order fulfillment button, you will see all the orders. They would be in the accepted state by default. Now you can mark it as Pick, Pack to process the order. If the order needs to be shipped, you will have to click on Ship and then process it Hope this helps!

Share Story :

Convert Email Body from HTML format to Text

Introduction: We had a requirement , wherein when an Email is received a Case will be created in CRM and the body of the email will be set the description of the case. However we faced a problem because the Email body was in HTML format so we have to convert it and set it as the description. Solution: We have to write a plugin in which just take the HTML part of the email and eliminate every HTML tags so that we can get the Text part of the body. Steps: Register the plugin in PostOperation  PipeLine Stage and in Asynchronous Mode. First, get the body of Email in a String variable and call the function. string description = currentRecord.GetAttributeValue<string>(Email.ATTR_DESCRIPTION); string actualDescription = StripHTML(description); 3.Then write a function to convert all the HTML Tags in the following way. private static string StripHTML(string source) { try { string result; // Remove HTML Development formatting // Replace line breaks with space // because browsers inserts space result = source.Replace(“\r”, ” “); // Replace line breaks with space // because browsers inserts space result = result.Replace(“\n”, ” “); // Remove step-formatting result = result.Replace(“\t”, string.Empty); // Remove repeating spaces because browsers ignore them result = System.Text.RegularExpressions.Regex.Replace(result, @”( )+”, ” “); // Remove the header (prepare first by clearing attributes) result = System.Text.RegularExpressions.Regex.Replace(result, @”<( )*head([^>])*>”, “<head>”, System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result, @”(<( )*(/)( )*head( )*>)”, “</head>”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,”(<head>).*(</head>)”, string.Empty,System.Text.RegularExpressions.RegexOptions.IgnoreCase); // remove all scripts (prepare first by clearing attributes) result = System.Text.RegularExpressions.Regex.Replace(result,@”<( )*script([^>])*>”, “<script>”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”(<( )*(/)( )*script( )*>)”, “</script>”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); //result = System.Text.RegularExpressions.Regex.Replace(result, //@”(<script>)([^(<script>\.</script>)])*(</script>)”, //string.Empty, // System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”(<script>).*(</script>)”, string.Empty,System.Text.RegularExpressions.RegexOptions.IgnoreCase); // remove all styles (prepare first by clearing attributes) result = System.Text.RegularExpressions.Regex.Replace(result, @”<( )*style([^>])*>”, “<style>”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”(<( )*(/)( )*style( )*>)”, “</style>”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,”(<style>).*(</style>)”, string.Empty,System.Text.RegularExpressions.RegexOptions.IgnoreCase); // insert tabs in spaces of <td> tags result = System.Text.RegularExpressions.Regex.Replace(result,@”<( )*td([^>])*>”, “\t”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); // insert line breaks in places of <BR> and <LI> tags result = System.Text.RegularExpressions.Regex.Replace(result,@”<( )*br( )*>”, “\r”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result, @”<( )*li( )*>”, “\r”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); // insert line paragraphs (double line breaks) in place // if <P>, <DIV> and <TR> tags result = System.Text.RegularExpressions.Regex.Replace(result,@”<( )*div([^>])*>”, “\r\r”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”<( )*tr([^>])*>”, “\r\r”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”<( )*p([^>])*>”, “\r\r”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); // Remove remaining tags like <a>, links, images, // comments etc – anything that’s enclosed inside < > result = System.Text.RegularExpressions.Regex.Replace(result,@”<[^>]*>”, string.Empty,System.Text.RegularExpressions.RegexOptions.IgnoreCase); // replace special characters: result = System.Text.RegularExpressions.Regex.Replace(result, @” “, ” “,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”&bull;”, ” * “,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”&lsaquo;”, “<“,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”&rsaquo;”, “>”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”&trade;”, “(tm)”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result, @”&frasl;”, “/”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”&lt;”, “<“,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”&gt;”, “>”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”&copy;”, “(c)”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,@”&reg;”, “(r)”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); // Remove all others. result = System.Text.RegularExpressions.Regex.Replace(result,@”&(.{2,6});”, string.Empty,System.Text.RegularExpressions.RegexOptions.IgnoreCase); // for testing // System.Text.RegularExpressions.Regex.Replace(result, //this.txtRegex.Text,string.Empty, //       System.Text.RegularExpressions.RegexOptions.IgnoreCase); // make line breaking consistent result = result.Replace(“\n”, “\r”); // Remove extra line breaks and tabs: // replace over 2 breaks with 2 and over 4 tabs with 4. // Prepare first to remove any whitespaces in between // the escaped characters and remove redundant tabs in between line breaks result = System.Text.RegularExpressions.Regex.Replace(result,”(\r)( )+(\r)”, “\r\r”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result, “(\t)( )+(\t)”, “\t\t”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result,”(\t)( )+(\r)”, “\t\r”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); result = System.Text.RegularExpressions.Regex.Replace(result, “(\r)( )+(\t)”, “\r\t”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); // Remove redundant tabs result = System.Text.RegularExpressions.Regex.Replace(result,”(\r)(\t)+(\r)”, “\r\r”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); // Remove multiple tabs following a line break with just one tab result = System.Text.RegularExpressions.Regex.Replace(result,”(\r)(\t)+”, “\r\t”,System.Text.RegularExpressions.RegexOptions.IgnoreCase); // Initial replacement target string for line breaks string breaks = “\r\r\r”; // Initial replacement target string for tabs string tabs = “\t\t\t\t\t”; for (int index = 0; index < result.Length; index++) { result = result.Replace(breaks, “\r\r”); result = result.Replace(tabs, “\t\t\t\t”); breaks = breaks + “\r”; tabs = tabs + “\t”; } // That’s it. return result; } catch { //MessageBox.Show(“Error”); return source; } } 4. This is the Output. This is the Test Email that is been send to test. This is the email that is received in the Dynamics 365 CRM. This is the Case which is created. The description of the Case is the same as the Email

Share Story :

Suspend(Hold) and Recall a transaction in the POS in D365 Retail(Commerce)

Point of sale (POS) users can suspend in-progress transactions, and then resume them later or on a different register. Transactions are often suspended to quickly free up a register for a different task without losing any progress on the current transaction. For example, a store associate starts to process a customer’s transaction on a mobile device but must complete it on a register that has a cash drawer. In this case, the store associate can suspend the transaction on the mobile device, and then recall and resume it on a register. You can suspend a transaction by clicking on Suspend transaction button on POS and Recall it by using Recall transaction button You can void suspended transactions either by recalling the transaction and then performing the Void transaction operation, or by selecting the transaction in the Recall transaction list and selecting Void on the app bar. Alternatively, the store can be configured to prompt users to void suspended transactions when they close their shift. This can be configured from Functionality profile of the store. Hope this helps!

Share Story :

Create An Editable Grid View In PowerApps

Introduction: In this blog, we will learn how we can create an editable Grid View in PowerApps. Steps: 1.Set up a gallery in your Powerapps.     Insert a new gallery – Insert > Gallery > Vertical 2.Add Data Source to the Gallery you added.    Go to Properties > Click Data Source you want. 3.Delete the Label from the Gallery. 4.Add Text input control in the PowerApps Grid.    I have added 3 Text input control inside the Grid. 5. For each text input box: Set TextInput.Default = ThisItem.<fieldName> For eg: TextInput1.Default = ThisItem.Description 6.The output screen after adding the Default property. 7. You can change the field here. 8. To Save the changed value into the Data source, set the following: Set TextInput.OnChange = Patch(Products, ThisItem, { <fieldName>: TextInput.Text }) This will change and save the value into the CRM.

Share Story :

Secure Input/Output in Power Automate Run History

Isn’t it just too easy to see from Flow (Power Automate’s) Runs what data was passed on? A simple switch in the Power Automate designer will secure this. Default Behavior By default, if you have access to the Flow, you can simply go in and see the inputs Secure Input / Output In the Flow designer, you can select and step and go to Settings And turn on Secure Input / Output depending on what you want. It says this is still in Preview as of the day of writing this post. Once this is Active, it is denoted by a Lock symbol on the step you enabled it on. And now, when you try to look at the data, it will hide away the information Note: Please note that this will run only for the Run History records after this was turned on. The previous records will continue to show the data.   Hope this helps!!

Share Story :

RSAT (Regression Suite Automation Tool ) implementation and configuration for Finance and Operations

Purpose The Regression suite automation tool (RSAT) significantly reduces the time and cost of user acceptance testing. This tool enables functional power users to record business tasks using the Finance and Operations Task recorder and convert these recordings into a suite of automated tests without the need to write source code. Test libraries are stored and distributed in Lifecycle Services (LCS) using the Business Process Modeler (BPM) libraries. These libraries are also fully integrated with Azure DevOps Services (Azure DevOps) for test execution, reporting and investigation. Test parameters are decoupled from test steps and stored in Microsoft Excel files. Prerequisites Dynamics 365 for Finance and Operations test environment (Demo or tier 2 UAT environment Excel Azure DevOps: You will need an Azure DevOps Test Manager or Test Plans license. For example, if you have a Visual Studio Enterprise subscription, you already have a license to Test Plans. Pricing-https://azure.microsoft.com/en-us/pricing/details/devops/azure-devops-services/ For a demo environment, you don’t need to buy any license. Authentication Certificate: To enable secure authentication, RSAT requires a certificate to be installed on the RSAT client computer. The RSAT settings dialog box allows you to automatically create and install the authentication certificate. Installation Download Regression Suite Automation Tool.msi to your machine RSAT requires Selenium and web browser driver libraries. RSAT will prompt you if needed libraries are missing and will automatically install them for you. Configuration For RSAT Open RSAT application. Select the Settings button in the upper right to configure RSAT. And next steps will help you to find those required fields input. Go to project settings of Lcs for your projects. Go to Visual Studio Team Services. Here you need to mention the Azure DevOps project in the Azure DevOps site URL field. In order to do that, click on https://www.visualstudio.com Open Azure DevOps and create a new organization if there is not an existing one. Now create a new project as shown below Now you need to set up a security token by clicking on  account info>security Once you create the token, save it as you will not be able to access it again when you want to use it. Once that is done, go back to the main page and create a new test plan. Name it as RSAT-TT (or you can use any name) Now right click on RSAT-TT and create a new suite you can name it ‘Demo’. Azure DevOps setup is done. In Azure DevOps site URL mention Organization name that you set up in Azure DevOps. And in Personal access token field paste the token that you had earlier saved. Click on continue to select the project and continue, Save. Now you need to deploy it to the environment Next, open the Regression Suite Automation Tool, Go to settings in Azure Dev Ops Url field copy it from the LCS Access token should be the security token you had copied. Click on Test connection so the Project name and Test plan will populate. Now run VM. You will find Hostname and SOAP Hostname by going to IIS and then right-clicking on AOSService>Edit bindings. Copy both the Hostname and in Hostname and SOAP Hostname fields paste these values Admin username should be the username you use to login to your environment. To generate Thumbprint click on New and save at any location and then copy the generated certificate to the VM Open the copied certificate and install it to the local machine at personal and Trusted Root Certification Authorities locations.Now Open the wif file in admin mode in notepad from the given location of VM In wif file find CN name=127.0.0.1 exists or not. If not, copy the selected portion and paste it below the same authority block. Now add modify those lines as follows: <authority name=”CN=127.0.0.1″>             <keys>               <add thumbprint=”F46D2F16C0FA0EEB5FD414AEC43962AF939BD89A”/>             </keys>             <validIssuers>             <add name=”127.0.0.1″ />             </validIssuers>             </authority>  ( Note: Add thumbprint of installed Certificate in wif as shown)   Final steps include Copy thumbprint from RSAT settings (which was generated when you click on New) and paste it in wif file in your VM Then Mention the company name And Working directory Set default browser as internet explorer Save as and ok Next, Go to LCS open business process modeler and create a new Library Name it as RSAT, go to edit and rename the process as required and you may add a child node to it by clicking on the Add process.  Now go to Finance and operations, go to test recorder  Create recording by clicking on create a recording and perform the operation and then click on the stop button. Name it as per your need then Save it to Lifecycle services or Save this to PC option. Click ok Now go back to LCS in the project library and click on the requirement, tab check it’s syncing  Now Sync test cases and VSTS sync Next, go to Visual studio DevOps, test cases, click on Add existing Then click on the run query and click on Add test case  Now go to regression suite automation and load the test and download test cases. select test and click on new and generate test execution parameter files Then click on edit option for the older version to edit values in excel For older version For newer version Now edit metadata for the test in excel file and save and close Now Run the test after this step, automatic session for the test is handled by selenium where the browser will perform steps as test cases Then run the test and after it’s completed successfully click on upload (Note the result as passed)

Share Story :

How To Enable / Disable Maintenance mode Using SQL query in Dynamics 365 for Finance & Operations

In finance and operations for making any changes in License configuration form, you need to enable maintenance mode and after making desirable changes you need to disable to this mode. You can enable or disable maintenance mode using SQL query as well as command prompt. In this blog, we are performing this operation using the SQL query. The following are steps to enabling/disabling maintenance mode:- Open SSMS(Microsoft SQL Server Management Studio) in your server. Click on New Query and enter the following query to enable maintenance mode:- update dbo.SQLSYSTEMVARIABLESset dbo.SQLSYSTEMVARIABLES.VALUE =1 where dbo.SQLSYSTEMVARIABLES.PARM = ‘CONFIGURATIONMODE’   You can verify status using following command:-SELECT * FROM [AxDB].[dbo].[SQLSYSTEMVARIABLES] After this restart IIS services in some cases, you need to restart the server. perform your changes to the License configuration form. after desired changes are made you can disable mode using the following command update dbo.SQLSYSTEMVARIABLESset dbo.SQLSYSTEMVARIABLES.VALUE =0 where dbo.SQLSYSTEMVARIABLES.PARM = ‘CONFIGURATIONMODE’ Now again you can verify status using the same query in step 3 and again repeat step 4.I hope this blog will help you

Share Story :

Attach Custom Generic event to lookup field (one or multiple same field) in D365 portals

Posted On December 27, 2019 by Admin Posted in

Sometimes we may get some requirements with multiple lookup fields on the same Entity form on D365 Portals. Also, we may have to perform some operations on click of search button on these Lookup fields. Here, it is not possible to achieve this without writing javascript or jquery code mean-while, we also have to make sure that the click event should be generic (single event working for all similar lookup fields). This blog will guide you to attach generic click event on all the similar lookup field using jquery. Below is the sample code for the same.   $(document).ready(function () { $(“.genericContact”).parent().find(“button[title=’Launch lookup modal’]”).each(function () {//click for all lookup $(this).click(function () { //your  code here }); }); }); In the above code, selector genericContact is a custom css class added to all the similar lookup fields on an entity form. To see how to add css class to any attribute click here.

Share Story :

How to map Signature field into Word template

Introduction : As we know , signature field with pen control can not be mapped directly into word template. This blog will explain how to map  signature field into word template. Implementation : Steps to Add Signature Field Step 1 :  Create signature Field with data type multiple line of text and maximum length 15000   Step 2:  Then in the field properties -> control -> select Pen Control and Add. In word template ,signature field will map as a text field which contains base 64 separated by comma. As shown below. Steps for resolution: Step 1 : To map signature field in picture format in word template , create new field signature text with data type multiple line of text and maximum length 1048576.     Step 2 : Write plugin. Plugin will trigger on create of record and update of signature field. Plugin Explanation : Plugin will retrieve the value of signature and separate  ” data:image/png;base64 ” string followed by “,” (comma) and save remaining text in newly created signature text field.   Plugin Registration: Register a plugin on create and update of account entity     2.Plugin Code void SignatureUpdate(Entity account) { tracingService.Trace(“postmsg : ” + account); string signaturetext = string.Empty; string attributeToUpdate = string.Empty; Entity AccountUpdate = null; try { AccountUpdate = new Entity(); AccountUpdate.Id = account.Id; AccountUpdate.LogicalName = account.LogicalName; if (account.Contains(“new_signature”) && account[“new_signature”] != null) { signaturetext = account.GetAttributeValue<string>(“new_signature”); attributeToUpdate = “new_signaturetext”; AccountUpdate = ProcessSignature(signaturetext, AccountUpdate, attributeToUpdate); } service.Update(AccountUpdate); } catch (Exception) { throw; } } public Entity ProcessSignature(string signaturetext, Entity Account, string attribute) { //to split base64 and remaining text string[] substring = signaturetext.Split(‘,’); Account[attribute] = substring[1]; return Account; } 3. build the code and update assembly and trigger a plugin And upload this template . Result :

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange