Got it thanks.
"Joshua M. Andrews" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> ERROR:
>
> When I created the classes you gave me and compiled I get this error:
>
> Error #: 5373 Class 'Endereco', used by "App.Site:property:Endereco', does
> not exist.
>
> What should I change?
>
> Joshua
>
> "Nuno Canas" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > So, here it goes ...
> > I'll do the 4th Example a bit more complicated.
> > Maybe someone else has some good opinions on this model in order to get
> > it better.
> >
> > The first class I usualy create is "Identity" because anyone (customer
> > or person) has something in common:
> >
> > Class App.Identity Extends %Persistent [ ClassType = persistent,
> > ProcedureBlock ]
> > {
> > Property Name As %String [ Required ];
> > Property IRSNumber As %String(MAXLEN = 20);
> > Property Notes As %Stream [ Collection = characterstream ];
> > Index IRSNumberIndex On IRSNumber [ Unique ];
> > }
> >
> > Class App.Address Extends %SerialObject [ ClassType = serial,
> > ProcedureBlock ]
> > {
> > Property Street As %String;
> > Property EMail As %String;
> > Property Phone As %String;
> > Property Celular As %String;
> > Property Fax As %String;
> > Property URL As %String;
> > Property PostalCode As %String;
> > Property Country As %String;
> > Index StreetIndex On Street;
> > Index CountryIndex On Country;
> > }
> >
> > Class App.Person Extends App.Identity [ ClassType = persistent,
> > ProcedureBlock ]
> > {
> > Property DOB As %Date(FORMAT = 4, POPSPEC = "Date()");
> > Property Age As %Integer [ Calculated, SqlComputeCode = { Set
> > {Age}=##class(App.Person).CurrentAge({DOB})
> > }, SqlComputed, SqlComputeOnChange = DOB ];
> > Method AgeGet() As %Integer [ CodeMode = expression ]
> > {
> > ..CurrentAge(..DOB)
> > }
> > ClassMethod CurrentAge(date As %Date = "") As %Integer [ CodeMode =
> > expression ]
> > {
> > $Select(date="":"",1:(($H-date)\365))
> > }
> > }
> >
> > Class App.Site Extends %Persistent [ ClassType = persistent,
> > ProcedureBlock ]
> > {
> > Relationship Customer As App.Customer [ Cardinality = one, Inverse =
> > Sites ];
> > Relationship Contacts As App.Contact [ Cardinality = many, Inverse =
> Site ];
> > Property Endereco As Endereco;
> > }
> >
> > Class App.Customer Extends App.Identity [ ClassType = persistent,
> > ProcedureBlock ]
> > {
> > Relationship Sites As App.Site [ Cardinality = many, Inverse =
Customer ];
> > Property CustomerNumber As %String(MAXLEN = 20);
> > Property HeadQuarters As Site;
> > Property DeliveryAddress As Site;
> > Property FinancialContact As Person;
> > Index CustomerNumberIndex On CustomerNumber [ Unique ];
> > }
> >
> > Class App.Contact Extends App.Person [ ClassType = persistent,
> > ProcedureBlock ]
> > {
> > Relationship Site As App.Site [ Cardinality = one, Inverse = Contacts ];
> > Property Decision As %Boolean;
> > Query BySite(site As %integer) As %SQLQuery(CONTAINID = 1)
> > {
> > SELECT %ID, Nome FROM App.Contact
> > WHERE Site = :site
> > ORDER BY Nome
> > }
> >
> > }
> >
> > I hope you understand and this will help you.
> >
> > Regards
> > Nuno
> >
> > Joshua M. Andrews wrote:
> > > Nuno:
> > >
> > > Yes please provide some examples.  Thanks for your help!
> > >
> > > Joshua
> > >
> > > "Nuno Canas" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > >
> > >>Joshua,
> > >>You have many possibilities, i.e.:
> > >>
> > >>1 - Class Customer with Address and Phone as Ramon suggests;
> > >>2 - Class Customer and Class Address as Embedded Class in Customer;
> > >>3 - Class Customer and Class Address (both %Persistent) and related;
> > >>4 - Class Customer and Class Office (both %Persistent) and related and
> > >>Class Address as Embedded Class in Office; (this one is the one I
> prefer);
> > >>
> > >>If you need further help;
> > >>I'll post some examples on class definitions ;-)
> > >>
> > >>Regards
> > >>Nuno
> > >>
> > >>Joshua M. Andrews wrote:
> > >>
> > >>>I want to create a customer record.  Each customer should have an ID
> > >
> > > number
> > >
> > >>>and whenever I add an item to the customer (example:  address and
phone
> > >>>number) I want to make sure that the address and phone number are
added
> > >
> > > to
> > >
> > >>>that customer's ID number.  That way, whenever an employee looks up
the
> > >>>customer they can see everything about them (Address, phone, etc..).
> > >>>
> > >>>How can I do this?
> > >>>
> > >>>Thanks.
> > >>>
> > >>>
> > >>
> > >
> > >
> >
>
>



Reply via email to