Business Central Archives - Page 8 of 12 - - Page 8

Tag Archives: Business Central

Optimizing Project Impact: Continuous Monitoring of Client System Utilization for Enhanced Value Deliver using Business Central

Introduction: It is crucial for the management team to track the client’s utilization of the system as a key metric for assessing the project’s success and the value it brings to the client. To facilitate this monitoring process, I have developed a utility that can automatically generate and send reports to the management team, detailing the number of records created in specified tables. For example, during the initial master data upload phase, 1500 data added into the Customer table. Subsequently, over the following month, this figure increased to 1750 and then to 1950. Such trends signify that the client is utilizing the system in line with expectations. Pre-requisites: Configuration: Usage Statistics Setup Page: This page, contains two main fields:- Collect Statistics (Boolean) and Mail Recipients (which contains email id’s to which the report has to be send) and one more field that is primary key field is added in table but not in page and it is set to code due to which the header we get as required in Usage Statistics Setup Page. The datatype of the field primary key is set to header because the default number of code is null. Regex is used for pattern matching. Here, email validation is added on Mail Recipients. User can enter multiple email addresses in this format eg. abc@gmail.com;xyz@gmail.com. If the Collect Statistics is enabled than only you can process further and there should be at-least one mail id present in Mail Recipients. Usage Statistics Configuration Page: This page contains the actual data from which the data will be passed and report will be generated. The list and the card pages are also created with same fields. The “All Object With Caption” is used for viewing all object details in the system. The trigger lookup is used to get the table no. and table name at runtime. After fetching the specific table no. and table name, fields will filter according to the filter field 1 value, same goes for filter field 2 value. (filter field 2 is added according to the requirements.) The FieldsDisplay procedure is used to retrieve field no. and field name of the according to its record. In Filter Field 1 Name any field can be selected and filter field 1 value must be set according to that field. Create Statistics Report: This report is designed to automate the generation of usage statistics based on configurations specified in the “Usage Statistics Configuration” table. The report is flagged as “ProcessingOnly,” indicating it is intended for background processing rather than direct user interaction. The dataset within the report contains a data item with an “OnAfterGetRecord” trigger, which executes after each record is retrieved. This trigger is responsible for processing each configuration record, applying filters, and updating or inserting records into the “UsageStatistics” table. Additionally, the report features an “OnInitReport” trigger that checks the “Usage Statistics Setup” table to ensure that statistics collection is enabled. If this condition is not met, an error message is displayed, and the report exits. In essence, this report streamlines the creation of usage statistics in Business Central, adhering to specified configurations and ensuring the necessary setup conditions are satisfied before processing. Usage Statistics Page: After filter the number of records the data which will be generated will be displayed in this table. List will also be created with same fields. In Record Count the number of values are there which satisfies the filter condition. Send Statistics Report: This report is designed to send usage statistics via email. Let’s break down the code: The report begins with specifications such as its application area, caption, and usage category. Notably, it is marked as a “ProcessingOnly” report, indicating it is intended for background processing rather than direct user interaction. The OnInitReport trigger executes when the report is initialized. It checks settings in the “Usage Statistics Setup” table, ensuring that statistics collection is enabled (“Collect Statistics”) and valid mail recipients are specified (“Mail Recipients”). If these conditions are not met, error messages are displayed, and the report exits. The main functionality is in the OnPostReport trigger, which executes after the report is processed. It performs the following steps: Email Excel Sheet: In this, on 22nd date after applying the filters the output is given and on 24th it again checks by applying same filter since new data was not added in the respective table that’s why it is showing the same data. Conclusion In conclusion, the automated reporting tool plays a pivotal role in monitoring client system utilization, revealing encouraging trends such as the gradual increase in customer records. These insights affirm the project’s success and underline its value to the client, reinforcing our commitment to proactive monitoring for continual optimization and client satisfaction.

Get and Post Method in Business Central

Introduction: HTTP (Hypertext Transfer Protocol) is a protocol used for communication between web servers and clients. When a client sends a request to a server, it is called an HTTP request. The request consists of a request line, headers, and an optional message body. The request line contains the HTTP method, URL, and HTTP version. The headers contain additional information about the request, such as the user agent and content type.  When the server receives the request, it sends back an HTTP response. The response consists of a status line, headers, and an optional message body. The status line contains the HTTP version, status code, and reason phrase. The headers contain additional information about the response, such as the content type and server type. Pre-requisites: Configuration: So, in this we are going to use table extension of the table Item [Record id: 27]. It extends the “Item List” page by adding a button after the “History” action. The button is defined as an action with the following properties: ApplicationArea, Visible, Image, and trigger OnAction(). When the button is triggered, it sends an HTTP request using the HTTPRequestFact() and HTTPRequestFactPost() functions. The HttpClient.Get method to send an HTTP GET request to retrieve data from a remote server. The syntax for the HttpClient.Get method is as follows: [Ok := ] HttpClient.Get (Path: Text, var Response: HttpResponseMessage) Here, Path is the path of the resource you want to retrieve, and Response is the response received from the remote endpoint. The HttpClient.Get method returns a Boolean value indicating whether the operation was successful or not. If the operation was successful, the Response parameter will contain the response received from the remote endpoint. This code sends an HTTP GET request to the URL https://ene6g2z8lzf2g.x.pipedream.net/ using the HttpClient.Get method. The response received from the remote endpoint is stored in the Httpresponsemessage variable. If the operation was successful, the response is read as a string and stored in the Response variable. Finally, the Message function is called to display the response on the screen. The HttpClient.Post method to send an HTTP POST request to a remote server. The syntax for the HttpClient.Post method is as follows: [Ok := ] HttpClient.Post (Path: Text, Content: HttpContent, var Response: HttpResponseMessage) Here, Path is the path of the resource you want to post data to, Content is the HTTP request content sent to the server, and Response is the response received from the remote endpoint. The HttpClient.Post method returns a Boolean value indicating whether the operation was successful or not. If the operation was successful, the Response parameter will contain the response received from the remote endpoint. This code sends an HTTP POST request to the URL https://enni1en7jg0n.x.pipedream.net/ with the JSON payload constructed from the records in the current page. The HttpClient.Post method is used to send the HTTP POST request. The response received from the remote endpoint is stored in the Httpresponsemessage variable. If the operation was successful, the response is read as a string and stored in the Response variable. Finally, the Message function is called to display the response on the screen. The code first sets the filter for the current page to the “Item” record. It then loops through all the records in the “Item” record and creates a new JSON object for each record. The JSON objects are added to a JSON array. A new JSON object is created for the JSON array, and the JSON array is added to the JSON object. The JSON object is then written to a text variable. A new HTTP content object is created for the JSON payload, and the JSON payload is written to the HTTP content object. The HTTP POST request is then sent to the remote endpoint using the HttpClient.Post method. If the operation was successful, the response is read as a string and stored in the Response variable. Finally, the Message function is called to display the response on the screen. The RequestWithBasicAuthenticaton procedure takes in three parameters: Url, Username, and Password. It creates an HTTP request message with the given URL and sets the method to GET. It then adds the authorization method by encoding the username and password in Base 64 and adding it to the request headers. After that in if condition it sends an HTTP GET request to the URL specified in the Url parameter with basic authentication using the HttpClient.Send method. The HttpClient.Send method is used to send the HTTP GET request. The response received from the remote endpoint is stored in the ResponseMessage variable. If the operation was successful, the response is read as a string and stored in the Response variable. Finally, the Message function is called to display the response on the screen. Output: For Multiple Data, Conclusion: In conclusion, this blog has provided valuable insights into the fundamental concepts of HTTP GET and POST methods, along with an exploration of Basic Authentication in the discussed code. Readers now have a clearer understanding of how these key HTTP techniques, combined with authorization mechanisms, play pivotal roles in web communication, facilitating data retrieval, creation, and ensuring secure access. Introduction: HTTP (Hypertext Transfer Protocol) is a protocol used for communication between web servers and clients. When a client sends a request to a server, it is called an HTTP request. The request consists of a request line, headers, and an optional message body. The request line contains the HTTP method, URL, and HTTP version. The headers contain additional information about the request, such as the user agent and content type.  When the server receives the request, it sends back an HTTP response. The response consists of a status line, headers, and an optional message body. The status line contains the HTTP version, status code, and reason phrase. The headers contain additional information about the response, such as the content type and server type. Pre-requisites: Configuration: So, in this we are going to use table extension of the table Item [Record id: 27]. It extends the “Item List” page by adding a button after the “History” action. The button is defined as an action with the following properties: ApplicationArea, Visible, Image, and trigger OnAction(). When the button is triggered, it sends an HTTP request using the HTTPRequestFact() and HTTPRequestFactPost() functions. The HttpClient.Get method to send an HTTP GET request to retrieve data from a remote server. The syntax for the HttpClient.Get method is as follows: [Ok := ] … Continue reading Get and Post Method in Business Central

Opportunity to Sales cycle – Part 2

Introduction: A Step-by-Step Guide to Creating Opportunities and Processing Sales in Business Central Pre-requisites for creating Sales Opportunities: Create Sales Opportunities You can create opportunities from the Opportunity List page. Typically opportunities are created from a specific contact or salespeople. Globally search “Salesperson” and select related link. Select the salesperson from the list for whom you want to create an opportunity. On the salespeople card page, select opportunities action –> selected salesperson opportunities page will open up –> user can create new by clicking on New action. If opportunity is created through salespeople then salesperson code is automatically generated. Globally search “Contact” and select related link. Contacts list page will open up, user can select the contact for which opportunity has to be created. Click on Home –>Create Opportunity for new opportunity. Click on Contact–> Open Opportunity (To view existing opportunity of selected contact) If opportunity is created through contact then contact name is automatically generated. No. – This field is auto generated based on the set no. series. Description – Description of the opportunity. Contact no. – User can select existing contact or create new. Contact name: Contact name is auto generated based on contact no. Phone/mobile/email: Auto generated from contact card page. Contact company name: This field is auto generated from contact card page Salesperson code: if opportunity is created through salesperson then this field is auto populated, if not then user can manually select the salesperson. Campaign no. User can select specific campaign to link with the opportunity. Priority: The default priority is set as normal. Other priorities are Low and High. Sales Cycle code: This is a setup. (To know more refer part 1 of this blog) Status: The status field is updating automatically. Closed: Specifies if the opportunity is closed. Creation date: Opportunity creation date  Date Closed: Specify the date the opportunity was closed. Segment no.: User can link segment to the opportunity. (If any) Sales cycle stages To start the sales cycle, user can click on “Activate first stage” To move an opportunity through sales cycle stages: Sales cycle stage is automatically updated Fill in the rest of the details as necessary. To Close opportunity When the negotiations are finished, you can close the opportunity. When closing an opportunity, you can specify whether it was won or lost, as well as why it was closed. To specify a reason, you must set up closed opportunity codes. To Create Sales Quote To Create Sales Order To Delete Opportunities After you have deleted an opportunity, it is removed it from the Opportunity List page. Conclusion Microsoft Dynamics 365 Business Central provides a robust framework for creating opportunities and processing sales seamlessly. By following this step-by-step guide, you can harness the full potential of Business Central to optimize your sales processes, enhance customer relationships, and drive business growth. Hope this helps!

Opportunity to Sales Cycle – Part 1

Introduction: In this blog I will demonstrate the set ups for opportunities. The sequence for setting up opportunity to sales cycle is as follows: Opportunities: Any inbound lead could be viewed as a potential sales opportunity. You can make opportunities and link them to certain salespeople to keep track of possible sales. You must first build up sales cycles and sales cycle stages before you start working with opportunity management. When creating opportunities, you should include details such as the contact, salesperson, sales cycle, and dates as well as your estimates of the opportunity’s sales value and success odds. Set up Opportunity Sales cycle Codes: Set up Opportunity Sales cycle Stages: On the Sales Cycles page, select the line for which you want to set up stages, and then choose the Stages action. The Sales Cycle Stages page opens. Stage: Specify the stage number. Description: A description for particular stage Completed %: Specifies the percentage of the sales cycle that has been completed when the opportunity reaches this stage. Chances of Success %: Specifies the percentage of success that has been achieved when the opportunity reaches this stage. Activity Code: User can select the activity Code for particular stages. (Activities have to be created separately) Quote Request: this check box puts a validation on that particular stage to request quote. Allow Skip:  this check allows user to skip that stage. Date Formula: Specifies how dates for planned activities are calculated when you run the Opportunity – Details report. Comment: Specifies if comments exist for the selected stage. (To add comment on any stage, navigate to Related –> Sales cycle –> Comments) Set up activities with task: You can combine multiple task, in an activity. A task represents a step in the activity. You can assign activities to opportunities, salespeople, or contacts. Assign tasks or activities of tasks to opportunities. The following procedure describes how to assign activity tasks to opportunities. The steps are similar when you assign tasks to salespeople and contacts. I will be demonstrating how to create Opportunity and Process sales Opportunities in part 2. Hope this helps!

Posting Restriction in Business Central for different users for Purchase and Sales documents

Introduction Invoices and shipments are frequently handled differently by different businesses. Processes, for example, can range from one person posting everything on a purchase order to numerous employees working on their own sites. On the User Setup page, you can now select how each user can handle invoices. Steps to achieve the goal 1. Go to User Setup select the users you want to give this restriction and then there are two columns Sales Invoice publishing Policy and Purch. Invoice Posting Policy 2. There are three values in these options Below is the impact of the above three options in different documents of purchase and Sales transactions. Document Option 1: Allow Option 2: Prohibited Option 3: Mandatory   Displays a series of options Confirmation dialog Confirmation dialog Sales Order Ship Do you want to post the shipment? Do you want to post the shipment and invoice?   Invoice       Ship and Invoice     Sales Return Order Receive Do you want to post the receipt? Do you want to post the receipt and invoice?   Invoice       Receive and Invoice     Inventory Pick Ship Do you want to post the shipment? Do you want to post the shipment and invoice?   Ship and Invoice     Purchase Order Receive Do you want to post the receipt? Do you want to post the receipt and invoice?   Invoice       Receive and Invoice     Purchase Return Order Ship Do you want to post the shipment? Do you want to post the shipment and invoice?   Invoice       Ship and Invoice     Inventory Put-away Receive Do you want to post the receipt? Do you want to post the receipt and invoice?   Receive and Invoice     Warehouse Shipment Ship Do you want to post the shipment? Do you want to post the shipment and invoice?   Ship and Invoice     Note: If you are trying to post invoice transactions from the general journal the above restriction would not be used in the General journal table. Conclusion Thus we saw how we can restrict the users to post the purchase and sales transactions. Thank you very much for reading my work. I hope this helps!

How to display Media (Picture) Data from one table to another table and display it on the RDLC report

References FlowFields – Business Central | Microsoft Learn Creating an RDL Layout Report – Business Central | Microsoft Learn Pre-requisites Microsoft Dynamics 365 Business Central Cloud/On-Premises Introduction In this blog, I am going to showcase how to flow Media (Picture) from one table to another and how to display it on the RDLC report. Flow Media data from one table to another table For this example, I’ve made a simple Mediadatatype table with a few fields and kept the ‘Image’ field as a Media data type. Additionally, I created the ‘Image’ field as a Media datatype to the Purchase header table extension and used the Fieldclass property as a flowfield and the Calcformula for the flow Image on the ‘Image’ field. The Image flows on the Purchase order ‘Image’ field, where my assigned user Id is PD, thus the image will appear on the Image field. How to display Media data type (Image) on RDLC report. In the following example, I’ve added an Image column to the MediaDatatype report Open the report on RDLC layout. On an Image property, select the image source as a database, use an ‘Image/bmp MIME type, and set the Image expression.      Output Conclusion Thus, we saw how to flow Media datatype from one table to another and how to display it on the RDLC report. I hope this helps!

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!

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!

Use of Standard Journal in Dynamics 365 Business Central

Introduction In this blog, I will demonstrate using Standard Journal functionality in Dynamics 365 Business Central. Standard Journal Standard Journals provide users with the benefit of saving transaction details and utilizing them at a later stage. Consider monthly expense payments, users will manually enter the details for the current month’s initial payment and save the journal line entries for future usage. Steps to save Standard Journal Enter the ‘Code’ and ‘Description’ to uniquely identify the journal. Users can even enable the ‘Save Amount’ toggle button to save the amounts on the journal.  Steps to Reuse Standard Journal Please note: The changes made on journal lines will not reflect on the saved template. Conclusion This feature of Dynamics 365 Business Central is very useful for users who are working with Journals that are recurring in nature. Hope this helps!

Copy data between different companies using Configuration Worksheet

Introduction In this blog, I will demonstrate how to copy data between different companies using configuration worksheet. Previously we could only use Configuration packages or copy the company to copy data between companies. By using the Configuration worksheet users can copy data from specific tables in companies to their respective table in the current company. Pre-requisite Microsoft Dynamics 365 Business Central (On-premise/SaaS) Steps Globally search for “Configuration Worksheet” and click on the related link. Configuration Worksheet page opens up. Fill in the table you want to copy. Then click the ‘Copy Data from Company’ button on the action bar as shown in the below screenshot. Also, to use this function the ‘copy data from’ company table must have records and the ‘copy data to’ company table must have no records. A Pop- up page appears allowing the user to select the company from which data will be copied. The no. of records will be shown of the selected table. If the table selected has no records then the line won’t appear. If there are no issues, click on ‘Copy data’ action and a confirmation message will pop up before proceeding. A confirmation message pops up mentioning the data has been copied successfully. Other Actions Get Tables: Click on ‘Prepare’ on the action bar, there you will find the ‘Get Tables’ button. This lets the user add tables by using filters as shown in the below screenshot. Get related tables: User can find another button by clicking ‘Prepare’ and in that ‘Get related Tables’. This function adds all Vendor-related tables and fields anchored on other tables. Please note: Table relation with filtered view and conditional table relations are not considered here. Delete Duplicate lines: Users will find this button under the ‘Prepare’ action. This function deletes duplicated lines as shown in the below screenshot. The vendor line was repeated, by using this function it deleted duplicate lines. Conclusion: In this blog, we learned about copying data from multiple companies into the current company by using a configuration worksheet. Hope this helps!

SEARCH :

FOLLOW CLOUDFRONTS BLOG :

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange