D365 Business Central Archives - Page 26 of 33 - - Page 26

Category Archives: D365 Business Central

Saving the Data of NAV 2018 after upgrading the extension in Visual Studio Code

Introduction: In NAV 2018, after installing the extension the data of the newly created fields using extension is to be filled. But after upgrading the extension the data of the added field gets flushed out. Thus, this blog demonstrates how to configure to prevent the data from getting flushed. Pre-requisites: NAV 2018 CU2 along with its Installation DVD Zip Demonstration: Goto Visual Studio Code and uninstall the previous version AL Language Extension. Install the extension from AL Language from the path “C:\Users\<Username>\Downloads\CU 02 NAV 2018 NA\NAV.11.0.20348.NA.DVD\ModernDev\program files\Microsoft Dynamics NAV\110\Modern Development Environment/ALLanguage.VSIX” file. Select the .VSIX file. Reload the AL Language Extension. Adding the following lines to ‘launch.json’ file If the data is to be saved :-  “schemaUpdateMode”: “Synchronize” If the data is to be flushed :- “schemaUpdateMode”: “Recreate” Conclusion: This feature wasn’t included NAV 2018 and the data used to get flushed everything the extension was upgraded. Thus, the data flushing issue was resolved in NAV 2018 CU2 version.

Share Story :

How to avoid data deletion when Dynamics NAV 2018 extension is published from VS Code

Introduction: There was a bug till NAV 2018 CU 1 update that whenever a NAV 2018 extension is published from VS Code, all the data which was inserted earlier gets deleted. Pre-requisites: Microsoft Dynamics NAV 2018 CU 2 Visual studio code (VS Code) Steps: 1. Install Microsoft Dynamics NAV 2018 CU 2 2. Install VSIX Extension for VS Code Click on Extension button at the Left corner of VS code. Click on the more button ( three dots) and select Install from VSIX. Navigate to the path  “CU 02 NAV 2018 NA\NAV.11.0.20348.NA.DVD\ModernDev\program files\Microsoft Dynamics NAV\110\Modern Development Environment” to install VSIX. 3. Open the launch.json file and enter schemaUpdateMode to synchronize How data synchronization works? The data synchronization between each publish is controlled by schemaUpdateMode setting, which is specified in the launch.json. This setting consists of two options; Synchronize and Recreate. The default value for schemaUpdateMode is set to the Synchronize mode, which means that every time you publish an extension to the development server, the data you entered previously stays. If you do not want to synchronize the sample data with each publish, you can change the schemaUpdateMode setting from Synchronize to Recreate Recreate mode: When you set the schema update mode to Recreate, all the tables and table extensions are recreated at every publish, which means that all the data in those tables are lost. This means that you will get empty records when you publish your extension.

Share Story :

Deferral of Income & Expenses in Navision

Introduction: Microsoft Dynamics NAV allows you to set up deferrals of income and expenditure. These allow you to post transactions into a particular month but then spread the financial effect over a number of periods in a way you can specify. This article explains how to set up and use this functionality. Set up: First, you need to create a Deferral Template which will define how the deferral will work. To do this, type “deferral template” in the top right hand corner of the screen and open the Deferral Template list. You should see a screen like the following:- Either click on Edit to modify an existing template or New to create a new one.  You should then see the following screen:- Fill in the fields as follows:- Deferral Account – This is the GL Account code the deferral will initially be posted to.  This would normally be a Balance Sheet account; Deferral % – How much of the initial posting is to be deferred (can be from 1% to a maximum of 100%); Calc. Method – How the deferral will be calculated.  This can be one of:- Straight-Line, where an equal amount will be applied per period from the Starting to Ending Dates specified in the schedule; Equal per Period, where an equal amount will be deferred per period; Days per Period, where the amount deferred per period is based on the number of days in that period as a proportion of the total number of days in the whole deferral period; User-defined, where the amounts for each period are entered manually. Start Date – This can be one of:- Posting Date, the Posting Date of the document that generates the deferral; Beginning of Period, the beginning of the period in which the document is posted; End of Period, the end of the period in which the document is posted; Beginning of next period. No. of Periods – How many periods the deferral will be spread over. These are only default values, as we shall see later they can be amended on individual transactions if necessary. The next step is to assign the template to transactions. The simplest way to do this is to assign it to either a G/L Account, Resource or Item.  To assign it to a G/L Account, open the Chart of Accounts list, click on the account you wish to set the template for and click on the Edit button.  You should see the following screen:- On the Posting tab, set the Default Deferral Template as required. You can now start to use the Deferral functionality.  We will use a purchase order as an example.  Create a new purchase order and add a line for the G/L Account code you assigned the Default Deferral Code to.  Add a Quantity of 1 and a Direct Unit Cost. Use the Choose Columns functionality to make sure you can see the Deferral Code field.  By default, you should able to see the code as in the screen shot below. You can add, delete or change the code if you wish. To see the effect the posted deferral will have over time, drill down on the Line button below the Lines caption on the page and click on the Deferral Schedule option. The following screen should appear:- You can amend the deferral amount and dates and change the spread of the amounts over time if needed.  If you do make any changes, you may need to click on the Calculate Schedule button at the top of the page to recalculate the deferral amounts. Now receive and invoice the order. Note: You will need to set the Posting Date range on either your User Setup record or the General Ledger Setup date range to allow you post up to the last period the deferral will cover. If you do not, you will see an error message that a Posting Date is not within the allowed posting date range. Now bring up the Posted Purchase Invoice you created when you invoiced the order and click on the Navigate button.  If you view the G/L Entries for the invoice you should see something like the following:- As you can see, the cost has been posted to the deferrals g/l account rather than the account specified on the purchase order and the first month has then been reversed out and posted to the original account in accordance with the deferral schedule. Note that you cannot see the reversals of the deferral over the subsequent month of the schedule. To display these, remove the filter of the Posting date by clicking on the red x button immediately to the left of it.  You should now see the following screen:- Conclusion: As you can see, this shows the original entries and the entries that reverse out the deferral over the period of the deferral schedule. This Feature of Deferral is Available after NAV 2016 version only.

Share Story :

Creating a Control Add-in using Javascript and calling it in AL.

Introduction: In NAV 2017, control add-ins were called through .NET code which is imported as .ZIP files. With NAV 2018 .NET is not supported in extensions. Thus we’ve to perform the following steps to make a Control Add-in in Javascript. Pre-requisite: 1. NAV-2018 2. VS Code Procedure: Create a Startup script as start.js: Startup scripts are loaded whenever the NAV object containing the control add-in starts. Basically, the startup scripts are used for initialization. Create a Javascript file as demo.js : Contains most of the logic that the control add-in performs.  Create a control add-in object in AL: Control Add-in objects are used by NAV to register the control add-in and events and procedures on which the control add-in works. Create a NAV object using AL: This object generally contains the control add-in integrated into the standard, created or customized NAV objects. This object acts as the starting point where events are performed. Output: Added Control Add-In: Invoking on INIT: Script Invoking on Event: Conclusion: Thus, we can create control add-in using Javascript and access in NAV .AL objects using extensions

Share Story :

Setup multiple No. Series for a single field in NAV

Introduction: This blog shows how multiple number series are to be set up for a single field in NAV. The number series has to be setup dynamically on Assist-Edit of the page. Pre-requisite: NAV 2017 Demonstration: 1. Create a No. Series : Create a number series in the No.Series and then create a relationship. 2. Create a field in Sales & Receivable Setup which has relation No. Series Table: 3. On the Card Page Enable the AssistEdit property for that field. On the Assist Edit Trigger add a function call and Update the current page: This function checks whether the field No.Series is present in the Sales & Receivables Setup and then runs the No.Series via RUNMODAL using SelectSeries and selects the current series using SetSeries function. 4. Result: Conclusion: Thus, by this method, multiple customized No. Series can be added to a single field.

Share Story :

Error resolution to the error “You are not authorized to sign in. Verify that you are using valid credentials and that you have been setup as a user in Microsoft Dynamics NAV”

Introduction: When we restore the SQL database from one server to the other server and when we launch the Microsoft Dynamics NAV RTC, we the error “You are not authorized to sign in. Verify that you are using valid credentials and that you have been setup as a user in Microsoft Dynamics NAV”. This blog article gives the steps how to resolve this error. Pre-requisites: Microsoft Dynamics NAV SQL Server Management Service(SSMS) Reason for the error: When an SQL backup is restored from one server to the other, even the Windows users created in the previous server is restored to the new server which is not present. Hence, the error is thrown. Steps: 1. Open SSMS and select the database restored. 2. Click on new query and type in the below query. USE [Database Name] GO delete from [dbo].[User] delete from [dbo].[Access Control] delete from [dbo].[User Property] delete from [dbo].[Page Data Personalization] delete from [dbo].[User Default Style Sheet] delete from [dbo].[User Metadata] delete from [dbo].[User Personalization] 3. Enter the database name and click on execute. 4. Now restart the server instance and launch the Role Tailored Client(RTC) and make sure a windows user is made in  users in the RTC.

Share Story :

Expense management in NAV 2018

Introduction: In previous versions of NAV, employees had to be set up as vendors to post expenses. Now, NAV 2018 allows expenses to be posted against employee cards, with a range of tools to simplify the process. Features: In NAV 2018, in the Account type field a new value of Employee is added. Create Journal entries directly for employees – only supports local currency (LCY) Employee posting group, definable on the employee card. Make payments to the employee in the Payments Journal. Get payment suggestions with a full list of outstanding employee payments. Apply payments to open employee entries in one go, linking the payment to the employee journal entry and closing both. Correct mistakes with unapply payments. Posting a general journal line with Employee as account type or balancing account type will generate an employee ledger entry. When posting a general journal line for an employee, the Document type field must be either blank or set to Payment. Conclusion: This feature is very useful for Reporting purpose as well as to maintain Employee wise details in the system.

Share Story :

How to configure Visual Studio Code(VS Code) for Extensions in Microsoft Dynamics NAV 2018

Introduction: Developement in Microsoft Dynamics NAV  2018 through extensions is done using Visual Studio Code. This article gives the steps how to configure Visual Studio Code on Microsoft Dynamics  NAV 2018 for Extensions. Pre-requisites: Microsoft Dynamics NAV 2018 CU 1 Visual Studio Code. Steps: 1. Run the Microsoft Dynamics NAV 2018 setup, click on Add or remove components then click on  the Modern Development Environment and select Run from My Computer. 2. Open Dynamics NAV Administration Console, select the server instance and click on Edit. 3. Under the Development tab at the bottom, Enable Developer Service Endpoint and Enable loading application symbol references at server startup. 4. Download Visual studio code from here and install VS Code. Method 1: 1. Open Microsoft VS Code and click on the Extension button at the left hand corner. 2. Install AL Formatter and AL Language. 3. Click on File and click on Open folder and select your folder containing objects in .al format 4. In the launch.json file enter the below credentials. 5. Click on Ctrl+Shift+P and click on download Symbols. This will download the symbols successfully. and VS Code is configured for extension in  NAV 2018 . Method 2 : 1. Unstall AL Formatter and AL Language. 2. Open Microsoft VS Code and click on Extensions under View Menu. 3. This will prompt you to select .vsix file. 4. Navigate to C:\Users\<user name>\Downloads\CU 01 NAV 2018 NA\NAV.11.0.19846.NA.DVD\ModernDev\program files\Microsoft Dynamics NAV\110\Modern Development Environment and select the .vsix file. and click on OK. 5. In the launch.json file enter the below credentials. 6. Click on Ctrl+Shift+P and click on download Symbols. This will download the symbols successfully and VS Code is configured for extension in  NAV 2018.

Share Story :

Converting NAV C/AL Objects into AL using TXT2AL converter tool

Introduction: When migrating from NAV 2017 to NAV 2018 i.e moving from C/AL to AL the created objects need not be created again from scratch in AL. This blog demonstrates how we can create the AL objects from C/AL using Txt2Al in Command Prompt. Pre-requisite: NAV 2018. Backup of Objects in TEXT or FOB format. Steps: 1. Import objects in NAV 2018 from the created  .TXT or .FOB files. In NAV Development Environment goto, Files > Import > Choose the .FOB or  .TXT file > Replace all the objects 2. Export the objects in New Syntax to .TXT files. Create a directory to store the objects in .TXT format which will be exported as new syntax. Here, ‘source’ is the name of the directory used. Use  ‘mkdir source ‘ Create a directory to store the .AL that will be created by TXT2AL Converter utility. Here ‘target’ is the name of the directory used. Use ‘mkdir target’ To export the objects in .TXT format in NewSyntax use the following command where Source Directory = ‘source’ Filename = ‘CU0-5.txt’ Database Name = ‘Demo Database NAV (11-0)’ SQL Server Instance = ‘.\NAVDEMO’ Type of Object = ‘codeunit’ ID = ‘50000..50005’  —-is the ID range Similarly, for Tables:  Type of Object = ‘table’; ID=’50000..50005′;filename=’TAB0-5.txt’ Pages:  Type of Object = ‘page’; ID=’50000..50005′;filename=’PAG0-5.txt’ Queries: Type of Object = ‘query’; ID=’50000..50005′;filename=’Query0-5.txt’ Reports: Type of Object = ‘report’; ID=’50000..50005′;filename=’REP0-5.txt’ Menusuite: Type of Object = ‘menusuite’; ID=’50000..50005′;filename=’MS.txt’ XMLPort: Type of Object = ‘xmlport’; ID=’50000..50008′;filename=’XMLPort.txt’ NOTE: TXT2AL requires objects exported in New Syntax 3. Generate the .AL object files using the  TXT2AL converter. To generate the .AL file from the .TXT files from source folder, run the following command where Source Directory = ‘source’ Target Directory = ‘target’ –rename = Used to create new .AL file per new object and give it the appropriate name of the ID and name. Conclusion: Thus, in this way, we can convert the objects in C/AL to AL format. Although the conversion is not 100% perfect but, most of the redundant work can be avoided.

Share Story :

Work Description field in Sales Quote in NAV 2017

In NAV 2017, Microsoft have added new field in Sales Area i.e. Work Description, which help users to add details about the Sales Quote and which gets copied over to Sales Invoice. This is the important field for the Sales people to give special instructions which can be used for Production if the goods are to be produced or for Stores department or Dispatch department for trading goods. The field is used to stored detailed information about the Order. There is no limitation on number of characters and it gets copied over to Posted Sales Invoice. It is a small feature in the system introduced in NAV 2017 but can be very useful.

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange