OK to set up foreign key constraint between UD03 and Part Tables

Most of what I learned came from this Group anyway. I'm just glad I
could pass some of it on.


--- In vantage@yahoogroups.com, Ahmet Erispaha <ahmeterispaha@...>
wrote:
>
> Hi Nigel,
> Â
> Thanks for your response.
> Â
> I tested this further with a pre-processing directive on
UD03.Update and the following query:
> Â
> for each ttUD03 where (ttUD03.RowMod = 'D') each Part where
(ttUD03.Key1 = Part.ShortChar01 and ttUD03.Company=Part.Company)
> Â
> It works!
> Â
> Thanks again for steering me in the right (BPM)Â direction.
> Â
> Ahmet Â
>
> --- On Tue, 11/11/08, Nigel Kerley <nigel.kerley@...> wrote:
>
> From: Nigel Kerley <nigel.kerley@...>
> Subject: [Vantage] Re: OK to set up foreign key constraint between
UD03 and Part Tables?
> To: vantage@yahoogroups.com
> Date: Tuesday, November 11, 2008, 10:58 AM
>
>
>
>
>
>
> Hi Ahmet.
>
> Just tried it myself and you're right. You can leave the "tt" out
and
> Vantage recognises the table. I got this query accepted:
> for each UD03, each Part where (UD03.Company = Part.Company) and
> (UD03.Key1 = Part.shortChar01)
>
> However, even if you get this working, I'm not sure that the BPM is
> getting actioned at all. I left out the conditions and just put in
an
> Action to display an informational message. I then went to the UD
> screen and deleted previouly entered data and it deleted with NO
> message!
>
> I've found this with a number of BOs, it seems some directives just
> don't cause BPMs to be actioned.
>
> Sorry I can't be more help.
>
> Anyone else have an idea?
>
> Nigel.
>
> --- In vantage@yahoogroups .com, Ahmet Erispaha
<ahmeterispaha@ ...>
> wrote:
> >
> > Thanks for the suggestion, Nigel.Â
> > Â
> > A BPM sounds like a great idea, however I'm having some
> trouble setting up the pre-processing directive.Â
> > Â
> > Here's what I have:
> > Condition:Â number of rows in the designed query is not less than 1
> > Query: for each ttUD03 where (ttUD03.RowMod = 'D') each
> ttUD03.Key1= Part.ShortChar01
> > Â
> > Vantage doesn't seem to recognize ttUD03 in the "Compose Query"
> window -- it doesn't color code tha table name. Then when I click
> the "Check Query" button, I get an "Unable to find any table in the
> query" Parsing Error.
> > Â
> > Where am I going wrong?
> > Â
> > Thx,
> > Â
> > Ahmet
> >
> > inde.com> wrote:
> >
> > From: Nigel Kerley <nigel.kerley@ ...>
> > Subject: [Vantage] Re: OK to set up foreign key constraint
between
> UD03 and Part Tables?
> > To: vantage@yahoogroups .com
> > Date: Tuesday, November 11, 2008, 4:14 AM
> >
> >
> >
> >
> >
> >
> > I haven't done any customisations like you've described, but a
> > possible solution to your problem would be to put a BPM in place
to
> > check if the category is being referenced before allowing it to
be
> > deleted.
> >
> > I suspect you would create a Pre-Processing directive against the
> > UD03.DeleteByID BO.
> >
> > HTH,
> >
> > Nigel.
> >
> > --- In vantage@yahoogroups .com, Ahmet Erispaha
> <ahmeterispaha@ ...>
> > wrote:
> > >
> > > I'm working on a customization that provides a way for our
> > engineering folks to categorize parts according to their needs
(so
> > that they can report on them or assign necessary changes to parts
> as
> > a group). We're on Vantage 8.03.406 and SQL Server.
> > > Â
> > > BACKGROUND:
> > > UD03Â will store information on each category such as
CategoryId,
> > Description, and whether the category is active or not.  The Part
> and
> > UD03 tables will be joined on Part.ShortChar01= UD03.Key1. Â
There
> will
> > be a one-to-many relationship between UD03 and Part, meaning each
> > part will belong to one category but each category can be
> associated
> > with many parts.
> > > Â
> > > So far I've created 1) a UD03 Maintenance screen that allows
the
> > user to create/edit/ delete categories; and 2) a customization to
> Part
> > Maintenance that allows the user to select an existing UD03
> category
> > from a dropdown and assign it to the current part.
> > > Â
> > > PROBLEM:
> > > User can delete a category in the UD03 Maintenance screen even
> > if that category is being referenced by a Part.  One way
to prevent
> > UD03 rows from being deleted would be to create a foreign key
> > constraint.Â
> > > Â
> > > QUESTIONS:
> > > Has anyone added a foreign key constraint in the
Vantage database?
> > > Are there any gotchas that I should be aware of?
> > > Does this affect the Vantage support agreement?   Â
> > > Â
> > > TIA,
> > > Â
> > > Ahmet Erispaha
> > > Â
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
I'm working on a customization that provides a way for our engineering folks to categorize parts according to their needs (so that they can report on them or assign necessary changes to parts as a group). We're on Vantage 8.03.406 and SQL Server.
Â
BACKGROUND:
UD03 will store information on each category such as CategoryId, Description, and whether the category is active or not.  The Part and UD03 tables will be joined on Part.ShortChar01=UD03.Key1.  There will be a one-to-many relationship between UD03 and Part, meaning each part will belong to one category but each category can be associated with many parts.
Â
So far I've created 1) a UD03 Maintenance screen that allows the user to create/edit/delete categories; and 2) a customization to Part Maintenance that allows the user to select an existing UD03 category from a dropdown and assign it to the current part.
Â
PROBLEM:
User can delete a category in the UD03 Maintenance screen even if that category is being referenced by a Part.  One way to prevent UD03 rows from being deleted would be to create a foreign key constraint.Â
Â
QUESTIONS:
Has anyone added a foreign key constraint in the Vantage database?
Are there any gotchas that I should be aware of?
Does this affect the Vantage support agreement?   Â
Â
TIA,
Â
Ahmet Erispaha
Â




[Non-text portions of this message have been removed]
I haven't done any customisations like you've described, but a
possible solution to your problem would be to put a BPM in place to
check if the category is being referenced before allowing it to be
deleted.

I suspect you would create a Pre-Processing directive against the
UD03.DeleteByID BO.

HTH,

Nigel.


--- In vantage@yahoogroups.com, Ahmet Erispaha <ahmeterispaha@...>
wrote:
>
> I'm working on a customization that provides a way for our
engineering folks to categorize parts according to their needs (so
that they can report on them or assign necessary changes to parts as
a group). We're on Vantage 8.03.406 and SQL Server.
> Â
> BACKGROUND:
> UD03Â will store information on each category such as CategoryId,
Description, and whether the category is active or not.  The Part and
UD03 tables will be joined on Part.ShortChar01=UD03.Key1.  There will
be a one-to-many relationship between UD03 and Part, meaning each
part will belong to one category but each category can be associated
with many parts.
> Â
> So far I've created 1) a UD03 Maintenance screen that allows the
user to create/edit/delete categories; and 2) a customization to Part
Maintenance that allows the user to select an existing UD03 category
from a dropdown and assign it to the current part.
> Â
> PROBLEM:
> User can delete a category in the UD03 Maintenance screen even
if that category is being referenced by a Part.  One way to prevent
UD03 rows from being deleted would be to create a foreign key
constraint.Â
> Â
> QUESTIONS:
> Has anyone added a foreign key constraint in the Vantage database?
> Are there any gotchas that I should be aware of?
> Does this affect the Vantage support agreement?   Â
> Â
> TIA,
> Â
> Ahmet Erispaha
> Â
>
>
>
>
> [Non-text portions of this message have been removed]
>
Thanks for the suggestion, Nigel.Â
Â
A BPM sounds like a great idea, however I'm having some trouble setting up the pre-processing directive.Â
Â
Here's what I have:
Condition:Â number of rows in the designed query is not less than 1
Query: for each ttUD03 where (ttUD03.RowMod = 'D') each ttUD03.Key1= Part.ShortChar01
Â
Vantage doesn't seem to recognize ttUD03 in the "Compose Query" window -- it doesn't color code tha table name. Then when I click the "Check Query" button, I get an "Unable to find any table in the query" Parsing Error.
Â
Where am I going wrong?
Â
Thx,
Â
Ahmet

inde.com> wrote:

From: Nigel Kerley <nigel.kerley@...>
Subject: [Vantage] Re: OK to set up foreign key constraint between UD03 and Part Tables?
To: vantage@yahoogroups.com
Date: Tuesday, November 11, 2008, 4:14 AM






I haven't done any customisations like you've described, but a
possible solution to your problem would be to put a BPM in place to
check if the category is being referenced before allowing it to be
deleted.

I suspect you would create a Pre-Processing directive against the
UD03.DeleteByID BO.

HTH,

Nigel.

--- In vantage@yahoogroups .com, Ahmet Erispaha <ahmeterispaha@ ...>
wrote:
>
> I'm working on a customization that provides a way for our
engineering folks to categorize parts according to their needs (so
that they can report on them or assign necessary changes to parts as
a group). We're on Vantage 8.03.406 and SQL Server.
> Â
> BACKGROUND:
> UD03Â will store information on each category such as CategoryId,
Description, and whether the category is active or not.  The Part and
UD03 tables will be joined on Part.ShortChar01= UD03.Key1.  There will
be a one-to-many relationship between UD03 and Part, meaning each
part will belong to one category but each category can be associated
with many parts.
> Â
> So far I've created 1) a UD03 Maintenance screen that allows the
user to create/edit/ delete categories; and 2) a customization to Part
Maintenance that allows the user to select an existing UD03 category
from a dropdown and assign it to the current part.
> Â
> PROBLEM:
> User can delete a category in the UD03 Maintenance screen even
if that category is being referenced by a Part.  One way to prevent
UD03 rows from being deleted would be to create a foreign key
constraint.Â
> Â
> QUESTIONS:
> Has anyone added a foreign key constraint in the Vantage database?
> Are there any gotchas that I should be aware of?
> Does this affect the Vantage support agreement?   Â
> Â
> TIA,
> Â
> Ahmet Erispaha
> Â
>
>
>
>
> [Non-text portions of this message have been removed]
>


















[Non-text portions of this message have been removed]
Hi Ahmet.

Just tried it myself and you're right. You can leave the "tt" out and
Vantage recognises the table. I got this query accepted:
for each UD03, each Part where (UD03.Company = Part.Company) and
(UD03.Key1 = Part.shortChar01)

However, even if you get this working, I'm not sure that the BPM is
getting actioned at all. I left out the conditions and just put in an
Action to display an informational message. I then went to the UD
screen and deleted previouly entered data and it deleted with NO
message!

I've found this with a number of BOs, it seems some directives just
don't cause BPMs to be actioned.

Sorry I can't be more help.

Anyone else have an idea?

Nigel.


--- In vantage@yahoogroups.com, Ahmet Erispaha <ahmeterispaha@...>
wrote:
>
> Thanks for the suggestion, Nigel.Â
> Â
> A BPM sounds like a great idea, however I'm having some
trouble setting up the pre-processing directive.Â
> Â
> Here's what I have:
> Condition:Â number of rows in the designed query is not less than 1
> Query: for each ttUD03 where (ttUD03.RowMod = 'D') each
ttUD03.Key1= Part.ShortChar01
> Â
> Vantage doesn't seem to recognize ttUD03 in the "Compose Query"
window -- it doesn't color code tha table name. Then when I click
the "Check Query" button, I get an "Unable to find any table in the
query" Parsing Error.
> Â
> Where am I going wrong?
> Â
> Thx,
> Â
> Ahmet
>
> inde.com> wrote:
>
> From: Nigel Kerley <nigel.kerley@...>
> Subject: [Vantage] Re: OK to set up foreign key constraint between
UD03 and Part Tables?
> To: vantage@yahoogroups.com
> Date: Tuesday, November 11, 2008, 4:14 AM
>
>
>
>
>
>
> I haven't done any customisations like you've described, but a
> possible solution to your problem would be to put a BPM in place to
> check if the category is being referenced before allowing it to be
> deleted.
>
> I suspect you would create a Pre-Processing directive against the
> UD03.DeleteByID BO.
>
> HTH,
>
> Nigel.
>
> --- In vantage@yahoogroups .com, Ahmet Erispaha
<ahmeterispaha@ ...>
> wrote:
> >
> > I'm working on a customization that provides a way for our
> engineering folks to categorize parts according to their needs (so
> that they can report on them or assign necessary changes to parts
as
> a group). We're on Vantage 8.03.406 and SQL Server.
> > Â
> > BACKGROUND:
> > UD03Â will store information on each category such as CategoryId,
> Description, and whether the category is active or not.  The Part
and
> UD03 tables will be joined on Part.ShortChar01= UD03.Key1.  There
will
> be a one-to-many relationship between UD03 and Part, meaning each
> part will belong to one category but each category can be
associated
> with many parts.
> > Â
> > So far I've created 1) a UD03 Maintenance screen that allows the
> user to create/edit/ delete categories; and 2) a customization to
Part
> Maintenance that allows the user to select an existing UD03
category
> from a dropdown and assign it to the current part.
> > Â
> > PROBLEM:
> > User can delete a category in the UD03 Maintenance screen even
> if that category is being referenced by a Part.  One way to prevent
> UD03 rows from being deleted would be to create a foreign key
> constraint.Â
> > Â
> > QUESTIONS:
> > Has anyone added a foreign key constraint in the Vantage database?
> > Are there any gotchas that I should be aware of?
> > Does this affect the Vantage support agreement?   Â
> > Â
> > TIA,
> > Â
> > Ahmet Erispaha
> > Â
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Hi Nigel,
Â
Thanks for your response.
Â
I tested this further with a pre-processing directive on UD03.Update and the following query:
Â
for each ttUD03 where (ttUD03.RowMod = 'D') each Part where (ttUD03.Key1 = Part.ShortChar01 and ttUD03.Company=Part.Company)
Â
It works!
Â
Thanks again for steering me in the right (BPM)Â direction.
Â
Ahmet Â

--- On Tue, 11/11/08, Nigel Kerley <nigel.kerley@...> wrote:

From: Nigel Kerley <nigel.kerley@...>
Subject: [Vantage] Re: OK to set up foreign key constraint between UD03 and Part Tables?
To: vantage@yahoogroups.com
Date: Tuesday, November 11, 2008, 10:58 AM






Hi Ahmet.

Just tried it myself and you're right. You can leave the "tt" out and
Vantage recognises the table. I got this query accepted:
for each UD03, each Part where (UD03.Company = Part.Company) and
(UD03.Key1 = Part.shortChar01)

However, even if you get this working, I'm not sure that the BPM is
getting actioned at all. I left out the conditions and just put in an
Action to display an informational message. I then went to the UD
screen and deleted previouly entered data and it deleted with NO
message!

I've found this with a number of BOs, it seems some directives just
don't cause BPMs to be actioned.

Sorry I can't be more help.

Anyone else have an idea?

Nigel.

--- In vantage@yahoogroups .com, Ahmet Erispaha <ahmeterispaha@ ...>
wrote:
>
> Thanks for the suggestion, Nigel.Â
> Â
> A BPM sounds like a great idea, however I'm having some
trouble setting up the pre-processing directive.Â
> Â
> Here's what I have:
> Condition:Â number of rows in the designed query is not less than 1
> Query: for each ttUD03 where (ttUD03.RowMod = 'D') each
ttUD03.Key1= Part.ShortChar01
> Â
> Vantage doesn't seem to recognize ttUD03 in the "Compose Query"
window -- it doesn't color code tha table name. Then when I click
the "Check Query" button, I get an "Unable to find any table in the
query" Parsing Error.
> Â
> Where am I going wrong?
> Â
> Thx,
> Â
> Ahmet
>
> inde.com> wrote:
>
> From: Nigel Kerley <nigel.kerley@ ...>
> Subject: [Vantage] Re: OK to set up foreign key constraint between
UD03 and Part Tables?
> To: vantage@yahoogroups .com
> Date: Tuesday, November 11, 2008, 4:14 AM
>
>
>
>
>
>
> I haven't done any customisations like you've described, but a
> possible solution to your problem would be to put a BPM in place to
> check if the category is being referenced before allowing it to be
> deleted.
>
> I suspect you would create a Pre-Processing directive against the
> UD03.DeleteByID BO.
>
> HTH,
>
> Nigel.
>
> --- In vantage@yahoogroups .com, Ahmet Erispaha
<ahmeterispaha@ ...>
> wrote:
> >
> > I'm working on a customization that provides a way for our
> engineering folks to categorize parts according to their needs (so
> that they can report on them or assign necessary changes to parts
as
> a group). We're on Vantage 8.03.406 and SQL Server.
> > Â
> > BACKGROUND:
> > UD03Â will store information on each category such as CategoryId,
> Description, and whether the category is active or not.  The Part
and
> UD03 tables will be joined on Part.ShortChar01= UD03.Key1.  There
will
> be a one-to-many relationship between UD03 and Part, meaning each
> part will belong to one category but each category can be
associated
> with many parts.
> > Â
> > So far I've created 1) a UD03 Maintenance screen that allows the
> user to create/edit/ delete categories; and 2) a customization to
Part
> Maintenance that allows the user to select an existing UD03
category
> from a dropdown and assign it to the current part.
> > Â
> > PROBLEM:
> > User can delete a category in the UD03 Maintenance screen even
> if that category is being referenced by a Part.  One way to prevent
> UD03 rows from being deleted would be to create a foreign key
> constraint.Â
> > Â
> > QUESTIONS:
> > Has anyone added a foreign key constraint in the Vantage database?
> > Are there any gotchas that I should be aware of?
> > Does this affect the Vantage support agreement?   Â
> > Â
> > TIA,
> > Â
> > Ahmet Erispaha
> > Â
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>


















[Non-text portions of this message have been removed]