Dynamics NAV

Showing posts with label Update. Show all posts
Showing posts with label Update. Show all posts

Wednesday, 22 April 2015

NAV UPGRADE Error : Invalid object name 'XXXX.dbo.company$xxxxx' The table for which the above error is occurring does not exists in NAV database or could not be found in SQL

We get the below error while converting the  database from NAV2009 to NAV2013.

 
 Invalid object name 'XXXX.dbo.company$xxxxx' The table for which the above error is occurring does not exists in NAV database or could not be found in SQL


Solution :

Object Metadata must have Table Reference in NAV2009  which table object does not exists in the current  database.


We have to remove the record and start upgrade again from the beginning.




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.