Dynamics NAV

Showing posts with label Data. Show all posts
Showing posts with label Data. Show all posts

Wednesday, 14 January 2015

How to Update/Modify Data in All Companies in the current database

We have Table 2000000006 – Company,which contains the list of companies exists in the database.
And also we have CHANGECOMPANY Function

Redirects references to table data from one company to another.

[Ok :=] Record.CHANGECOMPANY([CompanyName])
We can create a ProcessingOnly report to update the data in all companies using above table and function.
Ex: If I have to Update "Allow Posting From" and "Allow Posting To" field of General Ledger Setup table in all companies then:
1. Create a Processing Only report with Company as dataitem
2. write below code in Company - OnAfterGetRecord() trigger
   
GLSetup.CHANGECOMPANY(Name);

GLSetup.MODIFYALL("Allow Posting From",010213D);
GLSetup.MODIFYALL("Allow Posting To",280213D);

//You can use variables in Request Form for From Date and To Date




Here GLSetup is global variable of record type variable with General Ledger Setup table.

Thursday, 13 November 2014

Exporting and Importing Data in the Microsoft Dynamics NAV Windows Client


Exporting and Importing Data in the Microsoft Dynamics NAV Windows Client

To export or import data, in the Search box, enter Data File, and then choose the related link.
To export data, you specify the type of data that you want to export, and when you choose the OK button, you specify where you want to save the file.
To import data, you specify the .navdata file to import data from, but you can't import an application if the .navdata file contains an application. This is because you can't overwrite the application that is currently open in the Microsoft Dynamics NAV Windows client. So the window has one less type of data that you can choose to import: