Latest Microsoft Dynamics 365 Blogs | CloudFronts - Page 4

Master Data Sync across Companies in Business Central

Introduction In many Business scenarios we have two or more companies which work with the same Customers or Vendors or has same data that is to be shared with multiple legal entities. For such cases, manually making sure everything is in sync becomes difficult as the number of entities increases. For this, Business Central now comes with the functionality to sync master data across multiple companies. This can also be used by consultants for one time syncs if they simply need the setups from one company in another instead of going through the Configuration Package route. Pre-requisites Microsoft Dynamics 365 Business Central (Cloud/OnPrem) References Set up and sync master data across companies | Microsoft Learn Set Up Companies to Synchronize Master Data – Business Central | Microsoft Learn Configuration First, I’ve created two companies in a Sandbox Box which are going to have a uni-directional sync between them. It is possible to have a bi-directional sync however it may cause issues and may cause over-write of data if it isn’t configured properly. Here we can specify which company the data is going to be pulled from and whether we want to enable the synchronization or not. So, I’ll select “CRONUS USA Inc.” as the Source Company and then I’ll click on the “Synchronization Tables” action to show the list of the tables that I want to synchronize. Here by default, all the tables are enabled, I’ve disabled most of them and only selected a few.You can add your custom tables as well. Further, there’s also the option to add filters so if we only want data that fulfils a certain criterion to be pulled into this company that can be managed from here. An example of this would be, a Parent company which has Customers globally which has a local company in a particular country and only wants customers from the said. Further, we can also specify which exact fields we want to sync and whether we want to over-write the data if, there is any present in the current company, during the sync. After that, we go to the “Master Data Initial Sync.” action on the “Master Data Management Setup” and we see the list of the tables that are to be synced along with the “Sync. Mode”. We can change the Sync modes using the action at the top (“Use Full Sync” or “Use Match Based Coupling”) In either case, if we want the data in the Parent Company to over-ride the data in the child company, we have to set the “Overwrite Local Change” field either at the field level or the table level. If it is set to false, then the change fails, and we can see the same in the Synchronization Log. Once this is done, we can click on “Start All” which will start the synchronization process. It is only meant to be run once, as after this the synchronization jobs will take over. Once, everything is done syncing, we get the results as well. After this, as long as the “Enable Synchronization” is set to true on the “Master Data Management Setup” the jobs will keep the data in sync between the two companies. As an example, I’ve created a customer in the parent company and the same gets created into the child company directly within a few seconds. Conclusion Thus, we saw how we can use the native functionality of Business Central to sync data across companies. Happy Coding!

Share Story :

Attach a debugger to an Active User Session in Business Central

Introduction Business Central has recently introduced the functionality to attach a debugger to an active User session. This was previously available in NAV however it has only recently become available for Business Central. Pre-requisites Business Central Cloud/OnPrem References https://learn.microsoft.com/en-us/dynamics365/release-plan/2023wave1/smb/dynamics365-business-central/attach-al-debugger-active-session-or-next-session-specific-user Configuration To use this functionality, we simply need to create an entry in the launch.json file. Also, I tried using it for a Production Environment and as expected it didn’t work. Snapshot debugging it is then! Conclusion Thus, we saw how we can attach a debugger to an active user session in Business Central. Happy Coding!

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 :

Sending Email in Business Central without SMTP Mail

Introduction With SMTP Mail being deprecated, Business Central now provides us with a new and enhanced way for writing custom logic to send emails. To use this new functionality you have to first configure Email Accounts in Business Central, which you can find here. Pre-requisites Business Central onCloud References Developing with the new enhanced email feature | Dan Kinsella Configuration The new method uses the Email Message (ID: 8904) and Email (ID: 8901) Codeunits. I’ve added multiple actions below and I’ll be describing what the expected behaviour is. This is the simple piece of code which sends an email with the specified Recipients, CCs and BCCs.We can specify multiple recipients and dynamically as the lists are not bound by size. We can also call a simpler version of this method, where we don’t need to specify the CC and BCC. Changing the “OpenInEditor” procedure of “Email” codeunit causes a page to be opened up where you can edit the message before you send it. You can also add attachments or you can save the message draft. Changing the “OpenInEditorModally” procedure of “Email” codeunit causes a page to be opened up (as “RunModal”) where you can edit the message before you send it. You can also add attachments or you can save the message draft. “SaveAsDraft” procedure saves the email as a draft and you can view it in the “Email Outbox” where you can make any changes if necessary and send it directly from there. You can also add attachments to the email directly from code. Conclusion Thus we saw how we can send emails in Business Central v20.

Share Story :

Blocking Items in LS Central from POS

Introduction LS Central has its own unique way of preventing Items from being sold which is different from the standard “Blocked” option field we get on the Item Card. It also comes with detailed and refined permissions which can fit most business needs. All of this is done using another related table known as “Item Status.” Pre-requisites: Business Central OnCloud/OnPrem LS Central v16 References: Item Status (lsretail.com) How to Block Items From Sale at the POS (navisiontech.com) Configuration Open the Item Card for the Item you want to block.  Open the “Item Status” for that Item.  Click on the “Status Code” and Click on “Select from full list.”  Create a new record with code “BLOCKED” and enable all the fields. Here, you can see all the detailed controls available.  Conclusion: Thus, we saw how we can Block Items on POS in LS Central and other finer controls available at our disposal in LS Central.

Share Story :

How to resolve Error: Report _ does not have a layout of type None

Introduction Have you ever faced the error: “Report ___ does not have a layout of type None.” Here’s how you can resolve it. Pre-requisites Business Central OnCloud/OnPrem References https://community.dynamics.com/business/b/think-about-it/posts/how-do-i-fix-error-report-x-does-not-have-a-layout-of-type-none Configuration With the earlier versions of Business Central, you were allowed to run a report without specifying a layout, even if it was not a processing only report. However with the recent version of Business Central it is mandatory to specify both the “DefaultLayout” and the path to the layout via the “RDLCLayout” or “WordLayout” or “ExcelLayout” properties. Once these properties are the defined the error is resolved. Furthermore you can also resolve this error by using the report rendering section which has been made available since runtime 9.0. However be sure to define the “DefaultRenderingLayout” property for the report to specify which of the layouts defined should be considered as default. Conclusion: Thus we saw how we can resolve the error: “Report ___ does not have a layout of type None.” Happy Coding!

Share Story :

Using Dialogs to enhance User Experience in Business Central

Introduction We’ve all faced situations where we’ve had an operation take a long while which made the User wonder whether the system is stuck with something or is still processing. We can use simple dialogs which can enhance the User experience by showing User the progress of the operation. Some Business Central operations have out of the box dialogs which indicate progress like Posting documents or entries, Running reports with large data sets. Pre-requisites Business Central OnCloud/OnPrem References Dialog Data Type – Business Central | Microsoft Docs Dialog.Open(Text [, var Any,…]) Method – Business Central | Microsoft Docs Configuration While using the Dialog for creating windows, there are 3 procedures that we are going to be using. Open – It creates the window which we will be displaying the messages in. Update – It updates the content of the window based on the values that we pass in it. Close – It closes the window. We can create a simple Progress Window using the below piece of code. And this is the result for it. Please note that because there were two # in the Label, system has broken them into two separate lines. To avoid creating multiple lines within a single dialog box, we can use the StrSubstNo procedure which compresses the number of updates that we call to 1. We can now see that the content is visible in a single line. In Business Central 14 or previous versions of Business Central (which used windows client) it was possible to show the progress indicator in percentages using native APIs, however this functionality is not supported in Web Client. However we can still simulate it using text and creating our own basic procedure which converts the values to a String which will be used to indicate the progress. Conclusion: Thus we saw how we can use Dialogs to enhance User Experience and allow Users to visualize the processing of some long running task.

Share Story :

Using Live Share in VS Code

Introduction VS Code has recently introduced a new feature using which multiple people can access the same workspace in VS Code and modify files at the same time. This is huge applications in teaching, code reviews as well as prototyping. You can edit modify separate files at the same time in the same folder. Pre-requisites VS Code References Use Microsoft Live Share to collaborate with Visual Studio Code Configuration Install the Live-Share extension in VS Code.  Click on the “Live Share” button at the bottom left.  Sign in using your Github or Microsoft Account.  You can see the session details in the “Live Share” tab along with previously connected.  Click on the “Invite Participants” to get the link what can be used to share the session.  Now, you can collaborate with different Users and modify the same or different files together.  Conclusion Thus we saw how, we can use Live Share for collaborating while developing or reviewing in VS Code. Special thanks to Vaishnavi Joshi for her help in this blog!

Share Story :

Configuring NAS in LS Central for automating Data Director jobs

Introduction LS Central Scheduler Jobs are used for automatic background processing. These jobs use the NAS Service under the hood. We are going to see how to configure the NAS Service for LS Central. References https://help.lscentral.lsretail.com/Content/LS-Insight/Setup/LS-Central-In-Cloud-LS-Insight-In-Azure/3-Machine-Or-VM.htm Pre-requisites LS Central v16.4 – OnPrem Data Director Configuration Create a new Server Instance and name it appropriately.  Ensure that the account for this new Server Instance is set to User and the User has Administrator privileges.  In the General tab, update the “Service Default Company” and “Service Default Time Zone.” In the NAS Services tab, set the following fields: Run NAS Services with Admin Rights: True Startup Argument: NASID,TYPEFILTER=,LOG=1,REPEAT=1 Startup Codeunit: 99001468 Startup Method: LSRSCHEDULER Restart the Server Instance. Open the Scheduler Setup in LS Central and set the “Enable NAS Scheduler” to true.  Refresh the page. Conclusion: Thus we saw how to configure NAS Services in LS Central. Happy Coding!

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange