Category Archives: Blog
Recurring Sales in Business Central
Introduction: In this blog, we’ll be looking at how to reduce manual work in creating Sales Line in Business Central. For this, we’ll be using the Out of the Box feature of “Recurring Sales Lines” References: Standard Recurring Sales and Purchase Lines – Business Central | Microsoft Docs Configuration: Search for Recurring Sales Lines in Business Central global search and then click on New. Enter a Code for Identification, a short description and the Currency Code, if applicable. In the Lines, enter the Sales Line which are to be re-created. You can also define a Quantity if you want, it can be easily over-written if necessary. Go to the Customer Card for whom the Recurring Sales Line we created is going to be applicable. Then Go to Related > Sales > Recurring Sales Lines. Set the Code of the Recurring Sales Line, we just created and set the Valid From and Valid to Dates. The Insert Rec. Lines have the following options: Manual – System allows you to add the lines as and when required. Using the “Get Recurring Sales Lines” action. Automatic – System adds the recurring lines automatically whenever the Document is created. Always Ask – System shows a notification above which allows you to fetch the Recurring Lines in one click. Conclusion: Thus, we saw how to configure Recurring Sales Lines in Business Central which is a very useful tool in reducing manual work.
Share Story :
Integrate LeadFeeder with Dynamics 365 CRM
Introduction: Leadfeeder provides details of companies visiting your website, you can integrate the same to D365 CRM. STEP 1: Login to LeadFeeder; On the right corner click on your Account and then on Settings. You will see the below screen, click on Account to see all possible integrations. Click on Dynamics 365 STEP 2: Follow the integrations given on the page, click on the solution to download and then import to your CRM Environment. After publishing, add your CRM URL on point 2 and click authorize on point 3. The Sync process will start and you will be able to see below screen. You can make changes to settings are per your requirements. The auto sync works once per day, you can choose to Sync now. In case of issues, you can Reconnect or Remove the Integration as well.
Share Story :
How to dynamically show and hide the fields in the Request page of Business Central?
Introduction: Based on certain values dynamically show and hide the fields in the request page of the report. Ideally, we cannot directly use visible property to fields. we can do this by enabling the visibility of fields using groups. Steps to achieve the goal: Create a groups and add the fields which you want to show and hide based on selected data. For example, I have an option filed called Filter By- State, Customer, and Both. If I choose Customer then the Customer field should be visible and if I choose State then the State field should be displayed if I choose both then the Customer and State field should be visible. Create a 2 boolean variable which is of InDataset Create Customer and State field and assign it to groups in report. Then the field value which is been used to show or hide other fields write the below code OnValidate trigger So the above code will do the following if my Filter By field is State then the State field will be visible and if it is Customer then only the Customer field will be visible. If both are selected then both Customer and State fields will be visible. Note: If you want to show or hide the field based on only one value then you don’t need to use the InDataset attribute on the Boolean variable Conclusion: Thus we saw how we can dynamically show and hide the fields based on selected values on the request page in Business Central. Thank you very much for reading my work. Hope you enjoyed the article!
Share Story :
How to use Contact email and Sent email functionality on Vendor, Customer, and its Contacts?
Introduction: Contact email functionality is used in order to send emails to customers, vendors, and their contacts. Steps to achieve the goal: Go to Customers / Vendor and its Contact page there is action called as Contact By Email Then click on Contact by Email action. You will be able to get the email based on email address specified in Customer/ Vendor page in Email field. You can see the history of mails send to Customer, Vendor and its contacts. There is action called as Sent Emails action present on list page and also in Card page You will be able to see all the mails which is been send to Customer/Vendor/Contacts You can resend the same mail which is been sent to Customer using Resend action present in Send Emails page. You can also edit the existing mail which you have send earlier and send it with updated one Conclusion: Thus we saw how we can use the Contact email and Sent email functionality in Business Central. Thank you very much for reading my work. Hope you enjoyed the article!
Share Story :
Read items from Array in Power Automate
Let us consider we have array [1,2,3] and want to read each value in Power automate. Let see how we can read array in Power Automate Step 1- Create array (here you can use your array) Here I have array [1,2,3] and now I want read each value of array in loop Step 2 – Add apply to each step In a apply to each step, Add output of array. In this case we have compose. Step 3 – Add action compose and use expression item() to read array from compose Now Save and try to run the flow. In this way you can read value from array in Power Automate
Share Story :
Reopen Closed Appointment Using JavaScript in D365 CRM
Introduction: When an appointment is closed in D365 CRM, the appointment is not editable. There can be a requirment when Users wish to edit the closed appointment and add some missing data. This can be achieved by adding a new button on the Appointment form. Solution: Add a new button and use below JavaScript. var AppointmentForm = { setActive:function(primaryControl) { var formContext= primaryControl; var status= formContext.getAttribute(“statecode”).getValue(); if (status==1) { formContext.getAttribute(“statecode”).setValue(0); formContext.getAttribute(“statuscode”).setValue(1); formContext.data.save(); } } } To understand the status and status reason details, you can refer the Microsoft document- https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/appointment?view=dynamics-ce-odata-9 Note that, you need to update both statecode and statuscode, trying to update only one will give a system error. Conclusion: You can Activate and edit the appointment, once done user can click on Mark Complete, to close the appointment.
Share Story :
C# Code to retrieve lookup value id from target entity in D365 CE.
Let us consider below example as use case We have Plugin that triggers on Update of Contact Table and wanted to retrieve Customer related to Contacts. Customer is Lookup field on Contact Table. Hence here our target entity is Contact. Code – Entity targetEntity = (Entity)context.InputParameters[“Target”]; Guid ContactId = targetEntity.Id; Using the above code we get the target entity Contact Guid and now we need to retrieve Customer lookup from the target Entity. var cols = new ColumnSet(new String[] { “parentcustomerid” }); Since we only want Customer lookup from Contact hence retrieving only Customer and you can retrieve columns as per your requirement. Entity parententity = service.Retrieve(“contact”, targetEntity.Id, cols); We have stored Retrieved values in parententity. Guid ParentAccount = ((EntityReference)parententity.Attributes[“parentcustomerid”]).Id; And in above step we get the Guid of Customer. Conclusion – This was simple example of accounts and Contacts, you can use the above code(specify the schema name of lookup field you want to retrieve) to retrieve any lookups from your target entity based on your requirement Hope this helps !
Share Story :
How to unapply/reverse payments from vendors in Business Central?
There are certain scenarios where you have mistakenly applied the payment to the wrong vendor or you need to refund the vendor. There are two methods in order to resolve these issues. Steps to achieve the goal: Method 1: Globally search vendors. Select the vendor in which payment is applied incorrect. Go to Vendor Tab-> Ledger Entries tab. Open the Ledger entries of that vendor and then select the payment which you want to unapply. Go to Process tab and Unapply Entries. A Unapply Vendor Entries page gets open select the payment line and then click on Unapply action and click on OK. Once you click Ok the payment line in vendor ledger entries its remaining amount will not be 0. In order to balance the G/L entries we need to post the refund entry. Go to payment journal-> select the document type Refund Posting date must be same as Payment Posting Date or actual refund date. Assign the Account type as Vendor and assign the Vendor number. Select the Applies to Doc Type as Payment and in Applies to Doc No assign the Payment Document Number. Select the payment method code of return. Select the balance account number appropriately. Post the entry. If you go and check the vendor ledger entries it will be nullified against the refund. OR Method 2: Repeat above step number 1,2,3,4,5 and 6 from Method 1 Go to Process tab-> Reverse transaction. Reverse Transaction entries page is open and in which there is action called as Reverse Transaction click on it and entries will be reversed. Conclusion: Thus we saw how we can reverse/unapply the payment mistakenly applied to the wrong vendor in Business Central. Thank you very much for reading my work. Hope you enjoyed the article!
Share Story :
How Caching Works in Business Central
References: Data Access – Business Central | Microsoft Docs Database.SelectLatestVersion Method – Business Central | Microsoft Docs Explanation: Caching is one of the methods which systems use to improve performance and respond to requests rapidly. In a Business Central system, caching is done at two levels: Business Central Server Instance Data Cache SQL Server Data Cache. Whenever a User requests data from Business Central, it firsts check whether The data is available in the Server Instance’s cache, If not, then it checks the SQL Server Data Cache, And if not here then it fetches the data from the database. The Business Central Server Instance’s Cache is accessible to all the Users connected to that Server Instance. There are two types of cache stored here, Global Cache Private Cache Global cache is the one which is accessible to all the Users connected to the SQL Server. Private cache is only accessible over a transaction, for a particular User, for a particular company. This cache is cleared as soon as the transaction is completed. Which cache is to be used for which User depends on whether the Table from which the User is requesting data is locked or not. In case it is locked, Private Cache is queried else Global Cache is queried. The following procedures in Business Central support using Cache: GET GETBYSYSTEMID FIND FINDFIRST FINDLAST FINDSET COUNT ISEMPTY CALCFIELDS Whenever we make a call to the “FIND” functions, 1024 records are cached. The Data Cache size in Business Central can be changed using the “Data Cache Size” setting of the Business Central Server Configuration file. The default value is set to 9 which is equivalent to 500mb. Increasing the value by 1 doubles the cache size. If we want to latest data from the database to be fetched, i.e. if we want to bypass the cache, we can use the “SelectLatestVersion” procedure. The results from Query objects in Business Central are not cached. If there are multiple Server Instances over a single database, Business Central synchronizes the cache every 30 seconds by default. We can change this by using the “CacheSynchronizationPeriod” parameter in the CustomSettings.config file. Conclusion: Thus we saw how to Caching works in Business Central and how we can optimize it usage for maximum performance in Business Central.
Share Story :
Create attachments in SharePoint when email arrives
Use case – we wanted to retrieve attachment when new email arrives in outlook and create same file in SharePoint Let see how we can achieve this! Step 1 – Flow triggers on when a new email arrives trigger from Outlook connection. Step 2 – Retrieve attachments and Create file in SharePoint. Add step create file from SharePoint connection. In Create file, Add site address, Folder path, File name, File Content. Here file Content is the Attachment content from Trigger and File Name should be Attachment name. Save the flow and try. Hope this helps!
