Thanks for interesting. I had this problem on a big project database
and recreated scenario on a little testdb. Here's the script, this can
help your work:
CREATE DATABASE [TestDb]
GO
use [TestDb]
GO
CREATE TABLE [dbo].[Invoice] (
[InvoiceID] [int] NOT NULL ,
[DateCreated] [datetime] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[InvoiceRows] (
[InvoiceID] [int] NOT NULL ,
[RowNumber] [int] NOT NULL ,
[RowValue] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Rows] (
[RowNumber] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Invoice] ADD
CONSTRAINT [PK_Invoice] PRIMARY KEY CLUSTERED
(
[InvoiceID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceRows] ADD
CONSTRAINT [PK_InvoiceRows] PRIMARY KEY CLUSTERED
(
[InvoiceID],
[RowNumber]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Rows] ADD
CONSTRAINT [PK_Rows] PRIMARY KEY CLUSTERED
(
[RowNumber]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[InvoiceRows] ADD
CONSTRAINT [FK_InvoiceRows_Invoice] FOREIGN KEY
(
[InvoiceID]
) REFERENCES [dbo].[Invoice] (
[InvoiceID]
) ON DELETE CASCADE ,
CONSTRAINT [FK_InvoiceRows_Rows] FOREIGN KEY
(
[RowNumber]
) REFERENCES [dbo].[Rows] (
[RowNumber]
)
GO
This script creates relation between InvoiceRows and Rows. So in this
configuration the generation WORKS. But if you delete relation between
InvoiceRows and Rows NetTiers will not create InvoiceRowsCollection
field.
NOTE: I'm using NetTiers 1.1 and I don't know if problem is on 2.0 too.
Thanks again,
Mario.