Latest Microsoft Dynamics 365 Blogs | CloudFronts - Page 40

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!!

Share Story :

Secure your Environment Variable inside Azure Function using Key Vault

In the previous blog, we learn about how to use the Environment variable in Azure Function. Environment variables are most important and confidential as they might contain the system credentials or configure that you don’t want any to access directly. The most unsecure way to store them is directly inside the Configuration of Azure function so in this blog we will see how to store the Environment variable inside the Key Vault and use the Key Vault reference in Configuration. You can create an Azure function and use Environment Variable to do so do refer to my previous blog: Step 1: Create a Key Vault Login to Azure Portal and click on + Create a resource called “Key Vault”. Click on Create You can create a new resource group or select the existing group based on your preference. (You can create all resources related to a single project in one resource group so that it will easier to manage resources project wise) You need to set up the Access policy during the creation or after creating the Key Vault. We will set up an access policy for Azure Function later in the blog. Step 2: Set an Access policy for Azure Function. Open the Azure Function in which you want to use the reference of Azure Key Vault. Navigate to Identity Tab and toggle System assigned status to “ON”. Copy the Object (Principle) ID as we are going to use it during adding access policy. Open Azure Key Vault and Navigate to the Access Policies section. Click on + Add Access Policy We will only Add Get Permission in the Secret permissions section. You need to only add the permission that you want to allow your Azure Function can perform. Select the Principle User. Copy the Copied “Object ID” into search it will be easier to find it. Click on Add. Once you will add a resource in the access policy, it will allow your resource (Azure Function) to perform a Get operation on all the secrets from Key Vault. Do not forget to Save after you add the policy. Step 3: Add Secret and Configure it inside Azure Function Navigate to the Secrets section and Click on + Generate/Import Enter the Name and Value(Credentials/Configuration) Open the current version and Copy the secret URL as it will be required while configuring the Reference. Navigate to the Configuration section of Azure Function. Change the Configuration and add the KeyVault Reference as below: @Microsoft.KeyVault(SecretUri=<Copied SecretURL>) Do not forget to Save after changing the configuration Step 4: Testing using Postman We will require the API testing tool, here I am using Postman and the following is the link to download “Postman”. https://www.postman.com/downloads/ Copy the Function URL and send a post request. As result, you will notice the username is coming from KeyVault as we have to change the configuration. Conclusion: This is how you can secure your Environment Variable using Azure KeyVault. You can set up multiple KeyVault for different deployment and access policies depending on the requirement. When you are storing the Credentials and Configuration in KeyVault, you just need to set up the Access policy. All configuration is managed by the Azure Admin and if origination has a policy that they don’t want to share the credentials they can follow this process and only share the KeyVault URL with the developer so that they only need to configure it.

Share Story :

How to call logic app in Azure function app

In this blog, we will see how we can trigger the logic app using the azure function app. Let’s start with creating a logic app (HTTP triggered) that sends an email when the logic app URL is hit in the function app. Step 1: Create a logic app resource and start by adding an HTTP GET request trigger. Url will auto-generate after saving the logic app. Step 2: Add send email block after that to receive an email Step 3: now create a function app in visual studio by creating a new project. Step 4: Add project name and now select type of function app, select the create option Step 5: Add the below code to the auto-generated code template in the visual studio Step 6: Run the function locally. then you will get URL in the command prompt copy that and paste it into your browser. Step 7: After entering the URL you should receive an email as mentioned in the logic app. In this way, the logic app triggered successfully using the function app Hope this blog helps you. Thank you!!

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 :

How to Create Inventory Period in Business Central.

Inventory periods are used to keep track of when inventory adjusting entries are posted. Unless inventory periods are closed on a monthly basis, adjusting entries will post in the same period as the original transaction. Inventory adjustments will not be posted in that period if you create and close inventory periods. If the initial transaction was posted during a closed inventory period, the adjustments’ value is posted on the first day of the first open inventory period. This ensures that once the financial statements have been printed for a month, the G/L value of inventories, costs, and cost of goods sold do not change. CREATING INVENTORY PERIOD Many companies manage inventory the same time they manage accounting Period. Steps to access inventory period: Go to ‘Accounting Period’ Click on ‘Process’, there you find ‘inventory period’  OR You can simply Go to ‘Inventory Period’ from Global Search. STEPS TO CREATE AN INVENTORY PERIOD. Click On the search icon and enter Inventory Period, select relevant link.  Create a new line In the Ending Date Field, enter the last date in the inventory period that you want to define. When the period is closed, you will not be able to post inventory changes before this date. Enter a descriptive name in the Name field. CLOSING INVENTORY PERIOD. The Closed parameter specifies whether the inventory period is closed to changes in inventory value. This field is not editable. You can close any inventory period if the following conditions are met In that time period, there are no open outbound item ledger entries, showing negative inventory. The Adjust Cost – Item Entries batch job was used to adjust the cost of all goods. This means that any outbound transaction quantities must be applied to existing inventory numbers, such as those from sales orders, outbound transfers, sales invoices, buy returns, or purchase credit notes. TO CLOSE AN INVENTORY PERIOD Before closing an inventory period, choose the Adjust Cost – Item Entries action to ensure that all cost adjustments are posted.Run the Close Inventory Period – Test report to determine if there are any open outbound item entries within the inventory period or any items whose cost has not yet been adjusted. Choose the Close Inventory Period – Test action.Run the Post Inventory Cost to G/L batch job to ensure that all costs are posted to the general ledger. Choose the Post Inventory to G/L action. On the Inventory Periods page, select the inventory period you want to close. Choose the Close Period action. After the inventory period has been closed, you cannot post inventory changes before the ending date. The cost of all items must be adjusted with the Adjust Cost – Item Entries batch job before you close the inventory period. Choose the Yes button to confirm that you want to close the period, or choose No to cancel the closing. The inventory period is closed and a confirmation message is displayed when it is finished. REOPEN INVENTORY PERIOD It is not possible to delete an inventory period once it has been closed. You can, however, reopen it if you want to allow posting before the inventory period’s expiration date. When you reopen a period, it also reopens other inventory periods with ending dates later than the reopened period. TO REOPEN AN INVENTORY PERIOD Choose the icon, enter Inventory Periods, and then choose the related link. Select the inventory period you want to reopen. Choose the Reopen Period action. Confirm that you want to reopen the period. All inventory periods with ending dates later than the period you selected are reopened. Thank you for reading. Hope this helped. 🙂

Share Story :

Undo Bank Reconciliation in Business Central.

If you find a mistake in a posted bank reconciliation, you can correct it using the Undo action on the Bank Acc. Statement page. Steps to undo a Bank reconciliation: 1. Go to ‘Bank Account’ from the global search icon. 2. Select the bank account for which you want to undo the statement. 3. Open the Bank account Card Page, select ‘Bank Account’ and then ‘Statement’ 4.Select the statement for the bank account reconciliation that you want to reverse, and select Undo. 5. Select Yes When you undo a previously posted bank reconciliation, the entries are relocated to the Bank Reconciliation page and are marked as Open, indicating that they have not been reconciled. The bank reconciliation can then be corrected and re-posted. The bank account card provides the bank statement number and the balance from the last bank reconciliation. This indicates that the new bank reconciliation has a different number than the cancelled one. You can use the Change Statement No. action on the Bank Acct. Reconciliation page to use the same number as the cancelled bank reconciliation. Follow these steps to modify the number of a bank account reconciliation: 1. Go to Global Search icon and type in Bank Account Reconciliation, and then select the relevant link. 2.Change Statement No. after selecting Actions. 3. Enter the number you want to use in the New Statement No. area, then click OK. The Last Statement No. and Balance Last Statement fields on the bank account card are updated after the bank reconciliation is posted. This means that if the bank reconciliation you just completed isn’t the most recent, you may need to manually edit the Last Statement No. and Balance Last Statement fields on the bank account card. Thank you. Hope this helps! 🙂

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange