Category Archives: Blog
Using Task Scheduler in Business Central
Introduction: In Business Central, we can use Task Scheduler to utilize background processing to ensure that Users do not have to wait for completion of long operations. Task Scheduler provides us an easy to use and monitor way to offload tasks from the main thread. It creates separate sessions for processing and it allows creating multiple sessions which can be used to run tasks in parallel. It also allows us to define the company in which the processing will happening which is useful when we have to perform operations across all available companies, for example initialization of certain fields or creation of certain records on extension installation. Pre-requisites: Business Central OnCloud or OnPremise References: TaskScheduler Data Type – Business Central | Microsoft Docs Task Scheduler – Business Central | Microsoft Docs Configuration: The following procedures are available for the Task Scheduler data type: CanCreateTask() – Checks whether it is possible to create a new task in this session. CreateTask() – Creates a new task with the specified codeunit, we also specify which Codeunit to run if the main codeunit fails, whether the starts of this task would be Ready when it is created, the company this task will be running under and the time after which this task is to be run. TaskExists() – Checks whether the specified Task exists or not. SetTaskReady() – Sets the specified task status to Ready, a Task can only begin processing if it is in Ready state. CancelTask() – Sets the specified Task’s status to Cancel. A Task can only be set to cancel if it is in pending state. A task that is in progress cannot be cancelled. In case the main Codeunit hits an exception then there are two cases: The exception is retriable :- Business Central will re-try the main codeunit a specific number of times with a specific time interval, if it is unable to complete then the task is failed. The exception is not retriable :- The task fails and the session is deleted. Further if there is a failure codeunit defined then Business Central will run the Failure codeunit instead of failing the task and similarly if the Failure Codeunit hits an exception that is it unable to handle then there are same two cases: The exception is retriable :- Business Central will re-try the main codeunit a specific number of times with a specific time interval, if it is unable to complete then the task is failed. The exception is not retriable :- The task fails and the session is deleted. I have created an action which creates a simple task for all the companies available to the User. After that action is called, we can see that there are four separate sessions created with the same codeunit for different companies. The below is the screenshot of the page – Scheduled Tasks Conclusion: Thus we saw how to create and use Scheduled Tasks in Business Central for background processing. Business Central OnPremise requires some configuration before Task Scheduler can be used you can refer to the below link for the same.Microsoft Dynamics 365 Business Central Server Configuration – Business Central | Microsoft Docs
Share Story :
Passing parameters to JavaScript Web Resource function in Dynamics CRM
Introduction: In this blog we will see how we can pass parameters to a JavaScript function where the function is generic and can be reused. Implementation: Let’s take an example where you would check if account number is present or not in the account field. 1. Create a JS function to check if account number is present in the Account field. 2. Add function to the Web Resource library in solution. 3. Adding it to the form of the Account entity to reflect the output on load of the page. 4. Checking for the result on load of Account. Hope this helps …
Share Story :
Enable Auto Numbering for Field Service Entities in Dynamics 365 CRM
Introduction Autonumbering feature is useful to uniquely identify records and comes in handy when there are many records to filter. This blog will be the walkthrough for steps need to be performed in order to enable the auto numbering for field service entities. Lets take a scenario, there is a need to auto number the Work Order entity. So, let’s begin with the steps to configure the same. Step 1: Navigate to ‘Field Service Setting’ area and click on ‘Auto-Numbering’ button on ribbon bar. Now we can enable the auto numbering for Work Order entity. Click on ‘# Auto Numbering’ button. Step 2: This will open the pop-up window to Configure Auto-Numbering and ask you to select the entity for which you want to enable the auto numbering. So, select Work Order from the drop-down list. Step 3: Enter other configuration details as shown in the below screenshot. Let’s consider that we have 2000 existing work orders in CRM. The numbering for next work orders should start from 2001 with Field Service Auto numbering. For this we need to specify the Starting Number as ‘2001’. Click on ‘Apply’ in order to apply the changes. Step7: After clicking on Apply a message will be displayed — ‘Work Order settings have been successfully updated’. Now, Work Orders are ready for auto numbering and whenever new Work Order is created, Work Order number will be auto numbered from ‘2001’ since we have provided Starting Number as ‘2001’ in the configuration. Conclusion ‘Auto Numbering’ feature allows us to auto number the field service entities in field service and avoid duplicate records in CRM.
Share Story :
How to Merge Duplicate Customer Data in D365 Business Central
Scenario: A Business Central User receives a Sales order, the user then created a new customer and linked the new contact to it. The user Created a Sales Order and Posted it. Later found out that the user has created a duplicate customer. The new contact should be linked to Original customer. Steps: How to Merge Duplicate Customer Data. 1. In the Customer list below, the Original Customer no. 5000 has higher balance then the duplicate customer no. C00010 . The correct Contact, Mr Jim Halpert is set for duplicate Customer. 2. Now to Merge the duplicate Customer no. C00010 to Original Customer no. 5000, Open the Original Customer card and click on ‘Actions – Function – Merge with’ 3.The Merge duplicate page will open up, in the Merge with Field, enter the duplicate Customer no. In the fields FastTab, we can override the field value. In this case, check the Override box for contact as it needs to be linked to the original Customer. After updating the fields, now we can hit the Merge button on upper left corner. 4. A message will pop up, warning the user that the merging cannot be undone. The duplicate customer will be deleted permanently and data will be combined with original customer. 5. Now if we go back to Customer List, the duplicate Customer is deleted. The balance of Original customer has Increased. The relevant posted sales shipment and Posted sales Invoices are updated with duplicate customer’s data.
Share Story :
Fields in Customer and Vendor Posting Groups in D365 Business Central
CUSTOMER POSTING GROUPS Customer Posting Groups determines the account receivables account. 1. In the search option, enter Customer Posting Groups and then choose related link. 2. In the Code Field, type unique identifier. 3. In the description field, type description of Customer posting group. 4. In each relevant account field, enter the G/L account that will post the transaction accordingly. Receivable Account: This is a summary account where all the entries from customers will end up in balance sheet. Service Charge Account: This is a fee account where any fee you Charge to the customer when invoicing will end up here. Payment Discount Dr. Account: This account represents cash discounts given to the customers, then the sum representing the difference in original amount and what they’ve actually paid. This will be in debit field. Payment Discount Cr. Account: This account represents cash discounts given to the customers, then the sum representing the difference in original amount and what they’ve actually paid. This will be in credit field. Interest Account: It is an account to which, if you issue reminders or finance charge memos with interest on them, this interest revenue will be posted to this account. Additional Fee Account: This is where the reminder fees and finance charge momos will be posted when they are issued. Add. Fee per line Account: This is where reminder account will be posted if you have a reminder amount on each line of your remainders. Invoice rounding Account: This is where invoice rounding will be posted. Debit Curr. Appln. Rndg. Acc/ Credit Curr. Appln. Rndg. Acc: Both accounts are same except one is Dr and other is Cr. This account is particularly used when you are applying an entry on your customers from different currencies. E.g. Invoice is in USD but payment is in EUROS, in this case rounding difference will be posted to this account. Debit Rounding Account/ Credit Rounding Account: This is same as above mention field except the difference is of same currency and needed a slight adjustment. These accounts will therefore be used to Debit or Credit respectively. Payment tolerance Debit account/ Payment tolerance Credit account: These accounts are used to have a payment tolerance towards customers. e.g. If the customers is Invoiced USD 105 but customer pays only USD 100, and you have set a tolerance for 5USD which means the difference will be posted to these two accounts. Assign Customer Posting Groups to Customers 1. In the search option, enter Customers and then choose related link. 2. Open a Customer Card. 3. Expand Invoicing Tab, in Customer posting group field enter relevant details. VENDOR POSTING GROUPS Vendor Posting Groups determines the account payable account. 1. In the search option, enter Vendor Posting Groups and then choose related link. 2. In the Code Field, type unique identifier. 3. In the description field, type description of Vendor posting group. 4. In each relevant account field, enter the G/L account that will post the transaction accordingly, Payables Account: This is a summary account where all the transaction from vendors will end up in balance sheet. Service Charge Account: This is a account where you can put any service charge that might come from the vendor. Payment Discount Dr. Account: If you pay your vendor ahead to time and get a cash discount, a debit entry will end up in this account. Payment Discount Cr. Account: This account represents cash discounts given to the customers, then the sum representing the difference in original amount and what they’ve actually paid. This will be in credit field. Invoice Rounding Account: This account is used when an invoice from the vendor has to be rounded. Debit Curr. Appln. Rndg. Acc/ Credit Curr. Appln. Rndg. Acc: This account is used when the different Currencies have to be applied to each other and rounding has to be carried out. Debit Rounding Account/ Credit Rounding Account: This is used when you settle the outstanding amount in same currency but a little rounding off is to be done. Payment tolerance Debit account/ Payment tolerance Credit account: These accounts are used to have a payment tolerance towards vendors. Assign Vendor Posting Groups to Vendors 1. In the search option, enter Vendors and then choose related link. 2. Open a Vendor Card. 3. Expand Invoicing Tab, in Vendor posting group field enter relevant details.
Share Story :
How to Set Button Icons in Dynamics 365
Introduction: Let’s say we want to set an icon for a button on a form in Dynamics 365. We will use the Ribbon Workbench to do this. Let’s add this to our Quote form. First, create a solution and add Quote Entity: To add buttons, we will use SVG images. For the Web Client, we will use PNG images. There are online tools ( https://www.iconfinder.com/) to download these 2 formats. Let’s create a Approval button with approval images and save it as a Web Resource. PNG file: SVG file: Now open the Ribbon Workbench: Add a new button to the Form, and add the PNG and SVG images from above. The PNG images are Image 16 and Image 32, and the SVG image is Modern Image, then Publish: Once published, go to the Unified Interface app and pull up an Account. You will see the new button: Hope this helps…
Share Story :
Create, Update, Delete data Client side using XRM Web API in Dynamics 365 (Client API Reference)
Introduction Below is the Syntax that’s available to create, delete, update a record in Dynamics 365 Online V9.X using JavaScript. Create record (Client API Reference) Below is the Syntax that’s available to create a record in Dynamics 365 Online V9.X using JavaScript Syntax : Xrm.WebApi.createRecord(entityLogicalName, data).then(successCallback, errorCallback); Implementation : Let’s take an example where you would like to Create the Account record. // define the data to create new accountvar data = { “name”: “Sample Account”, “creditonhold”: false, “address1_latitude”: 47.639583, “description”: “This is the description of the sample account”, “revenue”: 5000000, “accountcategorycode”: 1 }// create account recordXrm.WebApi.createRecord(“account”, data).then( function success(result) { console.log(“Account created with ID: ” + result.id); // perform operations on record creation }, function (error) { console.log(error.message); // handle error conditions }); Update record (Client API Reference) Below is the Syntax that’s available to update a record in Dynamics 365 Online V9.X using JavaScript Syntax : Xrm.WebApi.updateRecord(entityLogicalName, id, data).then(successCallback, errorCallback); Implementation : Let’s take an example where you would like to Update the Account record. // define the data to update accountvar data = { “name”: “Updated Sample Account “, “creditonhold”: true, “address1_latitude”: 47.639583, “description”: “This is the updated description of the sample account”, “revenue”: 6000000, “accountcategorycode”: 2}// update the recordXrm.WebApi.updateRecord(“account”, “5531d753-95af-e711-a94e-000d3a11e605”, data).then( function success(result) { console.log(“Account updated”); // perform operations on record update }, function(error) { console.log(error.message); // handle error conditions }); Delete record (Client API Reference) Below is the Syntax that’s available to delete a record in Dynamics 365 Online V9.X using JavaScript Syntax : Xrm.WebApi.deleteRecord(entityLogicalName, id).then(successCallback, errorCallback); Implementation : Let’s take an example where you would like to Delete the Account record. Xrm.WebApi.deleteRecord(“account”, “5531d753-95af-e711-a94e-000d3a11e605”).then( function success(result) { console.log(“Account deleted”); // perform operations on record deletion }, function (error) { console.log(error.message); // handle error conditions }); Hope this Helps ….
Share Story :
How to create Date table using M query
You Might have seen the other ways to create the DateTable in Power BI using m query by adding two Custom columns such as startdate and enddate and then using DateRange function you can populate the dates between startdate and enddate However, in this blog, we will see the M query that enables you to create the datetable on user define the start and end date using parameters Step 1: Open the Power BI desktop application and then select the option Transform Data Step2: Click on the new source. then select the Blank query option from the dropdown Step3: Click on Advanced editor and paste the below query Step 4: After clicking on ok you will see the input fields to enter the start and end date Step 5: Enter the dates required and then click on Invoke You can see the new table is create for given date range Hope this helps you!! Thank You
Share Story :
Full Outer join Using DAX in Power BI
Thinking of full outer join in Power BI what comes first in your mind? How can we achieve full outer join in Power BI? Common Answer will be the “Use Merge Query” Option in Power Query Window. However, I would like to tell you that we can use DAX to achieve Full Outer Join. Full Outer Join = left Outer Join + right Anti Join Customer Table: Order Table: Click on new table and write the below DAX: DAX for Full Outer Join of Customer and Order Table: Result: Hope this helps!! Thank You!!
Share Story :
Display Horizontal Page tab in Power BI web
In Power BI Desktop app and when we edit the report on Power BI workspace, page tab visible at bottom, but when we publish the report on to the Power BI Service then it is visible on left side. We can change the Tab Position in the Power BI web as well, to do that we can follow below steps. 1.Go to report setting 2.Enable the option of Pages Pane enable the button and save the changes. And when we open the report tabs will be visible at the bottom. Hope this helps!
