Category Archives: Blog
Cancel the running flows with JavaScript code
We will look at how we can use JavaScript to cancel flows that are running without canceling each flow manually. To do this, follow the steps below. Let’s look at a scenario where we are seeing the flows that are in a running state and are not terminating. Click on All runs, this navigates you to all flow runs view. When we are in the All runs view, we need to open the developer console in the browser. The developer console can be opened by clicking F12 (or holding fn and F12) on Windows. Or by right-clicking on the screen and clicking Inspect. In the developer console, navigate to the Console pane. To clear the console window, click CTRL + L. The console pane is where we will add the JavaScript code that will cancel the running flows. As can be seen in the next step. // Copy this first and run it in the console var jq = document.createElement(‘script’); jq.src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js”; document.getElementsByTagName(‘head’)[0].appendChild(jq); // … give time for script to load, then type (or see below for non wait option) jQuery.noConflict() //Paste the same again var jq = document.createElement(‘script’); jq.src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js”; document.getElementsByTagName(‘head’)[0].appendChild(jq); // … give time for script to load, then type (or see below for non wait option) jQuery.noConflict() // Then copy this in the console to start the cancelation of the flows. confirm = function () {return true;}; setInterval(function () { $(“.fl-StatusInCell:contains(‘Running’)”).parent().parent().find(‘.ms-DetailsRow-cell’).last().click(); $(‘button[name=”Cancel”]’).click(); },5000); Click the running code after the code is implemented in the console, and the output will be seen below Hope this Helps!
Share Story :
Dynamic visibility of Gallery Items based on previous item data in Canvas PowerApps
Introduction Let’s say you come across a scenario where you want to show dynamic records for your gallery items based on previous record details. For example: Let’s say a basic Q&A where the User should input data and then proceed.So, I have created something similar that will help in developing such a design quickly and efficiently. Steps to implement in Canvas PowerApps Step 1: Create a collection that will store data of the gallery. (You can use Dataverse records here with the unique identifier in the collection.) Note: Collection is better to use if you are referring to the same table. If you use Gallery.AllItems then you will encounter errors and circular reference issues. Set a Blank Vertical Gallery where Items property is as follows: Step 2: Add a Text Input in Gallery that will accept the User’s Input Along with Questions. Conclusion That’s all. You got dynamic content based on previous values. I hope this helps!
Share Story :
Download SSRS report as a PDF with Power Automate – Part 2
In this blog, we will see how to extract the value for PdfDownloadUrl so we can load it into another request and get our PDF.
Share Story :
Download SSRS report as a PDF with Power Automate – Part 1
In this blog, we will see how to retrieve PDF Download URL from the console using the SSRS report. Step 1 – Create a new flow and set the trigger to Manually trigger a flow. Step 2 – After you have your trigger, you need to add two inputs to it, Report Name and Report XML. Step 3 – Then, add a List Rows action from the Dataverse connector and configure it to lookup the report by the Report Name. Step 4 – Setup the report viewer – We do this using the HTTP with Azure AD connector, specifically the Invoke an HTTP request action. Step 5 – We need to authorize our connection to use this action. If you’re using Dynamics 365 online, grab your CRM URL (including https://) and paste it in for both Base Resource URL and Azure AD Resource URL. Method POST Url of the request /CRMReports/rsviewer/reportviewer.aspx Headers Content-Type: application/x-www-form-urlencoded Body of the request id=report&iscustomreport=Custom Report&reportnameonsrs=Name on SRS&CRM_Filter=encodeUriComponent(ReportXML)&reporttypecode=Report Type For encodeUriComponent – Use the following encodeUriComponent(triggerBody()[‘text_1’]) Step 6 – Extract the PdfDownloadUrl from the Report Viewer page. Let’s extract the value for PdfDownloadUrl so we can load it into another request and get our PDF. We’ll do this in 3 parts in Part 2.
Share Story :
How to create a Business Central free trial tenant
Introduction Hi, Readers. Today I would like to talk about How to create a Business Central free trial tenant. References https://www.microsoft.com/en-in/microsoft-365/enterprise/office-365-e3?activetab=pivot:overviewtab Steps: Step 1: Search Office 365 E3 on Google or click on the below link. https://www.microsoft.com/en-in/microsoft-365/enterprise/office-365-e3?activetab=pivot:overviewtab Click on the Free trial Fill in personal details which are required Step 2: In the next screen, enter the domain you want example bclearning.onmicrosoft.com Set a password and click on Next Step 3: Enter Any Registration no. (Ex. Any Unique no.) You have successfully created an Office 365 account. Ensure that you are logged in with this account. Step 4: Now you need to open this link in your browser https://businesscentral.dynamics.com/ Click on Continue. Step 5: You can create multiple users here. If you don’t want it, just select the skip option. Here is your Business Central free trial tenant. Now you can explore Business Central. Hope this help. Thanks for reading.
Share Story :
Creating Sales Order/Sales Quote from POS in LS Central
Introduction LS Central allows us to create a Sales Order or Sales Quote directly from POS. I will be demonstrating the same below in this blog. Pre-requisites LS Central v16+ Business Central OnPrem/OnCloud References Suspend Type, Sales Type (lsretail.com) Configuration Search for “Sales Type” in Business Central Create a new record titled “SALES ORDER” in it. Make sure to set the Suspend Type to Sales Order/Sales Quote as required. I am setting it to Sales Order for this example. Log In to your POS with a POS Super User account and Right click on a button and go to button properties, I’m using the default “SUSPEND” button for example here. Set the command to “SUSPEND” and the parameter to the “Sales Order” record you created a few moments ago. Once this is done, create a new Transaction with a Customer and then click on the button. In the confirmation box, click on Yes. If you check in Business Central now, you can see that a new Sales Order has been created. You can also see the same from POS itself if you click on the “Sales Order” button that we created just now. Conclusion: Thus we saw how to create a Sales Order/Sales Quote directly from POS. Happy Coding!
Share Story :
Working with OData Bound Actions
Introduction OData Bound Actions allows us to perform logic in Business Central by hitting specific end points. We can also pass in parameters and get results in response. It’s very similar to using Azure Functions but is natively built into Business Central at no extra cost! In this example, we’ll be returns the Base64 version of an Image of a Customer, we will also see how to get the Image for any other customer as well. Pre-requisites Business Central OnCloud/OnPrem References WebServiceActionContext Data Type – Business Central | Microsoft Docs Creating and Interacting with an OData V4 Bound Action – Business Central | Microsoft Docs Configuration OData Bound Actions are written on Pages or API – Pages that you are declaring as Web Services. In this example below, I’ve created a simple Customer Page with a few fields and kept the OData key field as the “No.” field. I’ve also defined this as a Web Service in Business Central. To create a OData Bound Action, we create a Global Procedure with the Service Enabled decorator. In this procedure, we have to create a WebServiceActionContext variable and set the “ObjectType”, “ObjectID” and Keys that we are using for this Web Service, which is “No.” in this case, after our processing is done we also need to set the “Result Code” for this request. In the above piece of code, I’ve written simple logic which converts the content of a Media Data Type (Image field) to Base64 Text and returns it. In Post-Man if you check of the metadata, you’ll be able to see this action defined in the metadata. Now, it’s time to test out OData Bound Action! To call the OData Bound Action, we need to be working with a single record. So we specify the “No.” field to identify a single record. Now, we append our procedure name as “NAV.[Procedure Name]” and make a POST request. If we put this Base64 through a Base64 to File Converter, we can see that the original data is recovered. Now, we create a new procedure, which will take the System ID as a parameter and return the Image data for that Customer Record. If you want to pass the parameters to the OData Bound Actions, you have to do it as the Body of the Request. Conclusion: P.S. I’ve tried but it seems polymorphism doesn’t work with this. I hope this was insightful and a quick start on how to write OData Bound Actions. Happy coding!
Share Story :
How to configure Mailbox and set Regarding with in Outlook?
These are the following requirements for enabling D365 for Outlook. License that includes Outlook Email Exchange services Mailbox configured in D365 CRM Steps Below are the steps to approve the mailbox configuration of the Outlook add-in – Go to Advanced Settings -> Email Configuration 2. Select Mailboxes 3. Select the User you want to configure mailbox Note: Global Admin is required for Mailbox Approval. Once done proceed to next step 4. After clicking on OK, click on Test & Enable Mailbox 5. You will see success status as below 6. After the status changes to success, go to Outlook -> File -> Manage Add-ins 7. n Add-Ins for Outlook, search for Dynamics 365 and add it That’s it. Now you have D365 Addon for Outlook enabled. Hope this helps!!
Share Story :
Switching of Forms using Option Set field in Javascript
Use Case – To Switch form based on the value selected from option set field. Steps – 1. We have a Option Set field – “Lead Type“ Based on the Option selected – the form will switch For example – “PMO Member” – On change of the option, it will switch to PMO Member Form “HR” – On change of the option, it will switch to HR Form 2. To get the current form Guid use the following in the console- 3. Below JavaScript Code- Hope this helps!!
Share Story :
Switch BPF in Dynamics 365 using JavaScript
In today’s blog, we will cover how to change the BPF using JavaScript in the unified interface when the form loads based on a custom field Lead Type on the Lead form. Let’s take a closer look! Steps – In the example below, we have a new option set field called Lead Type with values of TAB Member and TBO. When the Lead Type has a value of TAB Member, update the business process flow to the TAB Member BPF and when the value is TBO, update the business process flow to TBO BPF. 2. Create two separate BPFs for the required entity. In this case, we created two separate BPFs for the Lead entity. 3. From each BPF, grab the record GUID using the console. 4. JavaScript Code- Results – Hope this helps!!