Options

Problems compiling object

Remco_ReinkingRemco_Reinking Member Posts: 74
edited 2012-04-13 in NAV Three Tier
What I have done is the following:
A 3.70 SQL database that was running with the 4.03 client on SQL2005
We converted this to NAV2009R2 build 32982
Everything is running fine in the Classic client.

But of course we want to use the new feature as webservices and pages.
So we try to Alter database to "Enable for Dynamics NAV Server"
The client will then compile all objects, but there the problem occurs:


Microsoft Dynamics NAV Classic
The following SQL Server error or errors occurred when accessing the Object Metadata table:

515,"23000",[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'Object Key', table 'NAVISION_TEST.dbo.Object Metadata'; column does not allow nulls. INSERT fails.
3621,"01000",[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.

SQL:
INSERT INTO "NAVISION_TEST"."dbo"."Object Metadata" WITH (REPEATABLEREAD) ("Object Type","Object ID","Metadata","Version List","User Code","Metadata Version") VALUES (1,3, NULL,'', NULL,60300)

OK


How is this funtion called? And how can I change this function so it will not insert NULL values in the [Object Metadata]
Are there some dll's that I should install on SQL-server?
I tried to change the field [enabledforserver] in table $ndo$dbproperty (just set in manually to 1, you never know)
but the effect is the same: no object can be changed, cause the compile function will try to insert data in then Object Metadata table with NULL values in the fields [Metadata] and [User Code]

Comments

  • Options
    Remco_ReinkingRemco_Reinking Member Posts: 74
    with help from Lars Lohndorf from Microsoft I could solve the problem.

    by adding the following contraint

    ALTER TABLE [dbo].[Object Metadata] ADD CONSTRAINT [$ndodefault$1342497153$24] DEFAULT (newid()) FOR [Object Key]

    it was done.
    Also needed:
    TRIGGER [dbo].[$ndo$objecttracking] ON [dbo].[Object Metadata] FOR DELETE, INSERT, UPDATE
    ALTER TABLE [dbo].[Object] ADD DEFAULT ('') FOR [Locked By]
    ALTER TABLE [dbo].[Object] ADD DEFAULT ((0)) FOR [Locked]


    trigger definition can be found in a demo database installation.
Sign In or Register to comment.