newbie question on tables relationships

Contains tips for configurators working with Aware IM
Post Reply
jonlau
Posts: 19
Joined: Tue Dec 26, 2006 8:18 am

newbie question on tables relationships

Post by jonlau »

Hi,

Want to know how to enter into awareIM where:-
1) CUSTOMER object
2) SUPPLIER object
3) COUNTRY object

- CUSTOMER may refer to MANY COUNTRY object
- SUPPLIER may refer to MANY COUNTRY object

if i create an atribute in CUSTOMER object called "myCountry" of the type "COUNTRY", How i can create the same for SUPPLIER ?

Also what's the diff between PEER, OWNER OF & OWNED BY ?

Thanks & Regards,

Jon Lau
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Just create "myCountry" attribute of the type COUNTRY in the SUPPLIER object in much the same way you created it for the CUSTOMER object.

"Owned by" means that the instance of the object cannot exist without an instance of its parent - for example, items in some order cannot exist without the order. Aware IM automatically deletes child instances if the parent is deleted. Please have a look at the User Guide for more details.
Aware IM Support Team
jonlau
Posts: 19
Joined: Tue Dec 26, 2006 8:18 am

Post by jonlau »

aware_support wrote:Just create "myCountry" attribute of the type COUNTRY in the SUPPLIER object in much the same way you created it for the CUSTOMER object.
is there a need to create attribute in COUNTRY e.g. "CountryName" & "link" it back to the CUSTOMER ?

1) What do i need to do to prevent the deletion of a COUNTRY if it already exist in either CUSTOMER or SUPPLIER ?
2) What do i need to do if i allow a COUNTRY to be deleted even if it already exist in either CUSTOMER or SUPPLIER ?

Thanks & Regards,

Jon Lau
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

is there a need to create attribute in COUNTRY e.g. "CountryName" & "link" it back to the CUSTOMER ?
If by link, you mean a shortcut, the answer is no -- that is not required. You may want to though if you wish to use CountryName in Customer queries, etc.
1) What do i need to do to prevent the deletion of a COUNTRY if it already exist in either CUSTOMER or SUPPLIER ?
Put a rule like the one below in the Country BO "Rules when object is deleted":

If EXISTS Customer WHERE (Customer.Country=Country) Then
REPORT ERROR 'Delete not permitted. Country exists in a Customer'
2) What do i need to do if i allow a COUNTRY to be deleted even if it already exist in either CUSTOMER or SUPPLIER ?
AwareIM will allow you to do this if it is a peer relationship. You do not have to do anything special.

Tom
Post Reply