I have a changelog object that has an attribute that is the uidnumber of the staff object. How do I write a query that will return all changelog objects that are associated with the staff object with the last name of "kacoroski". I want something like:
Find ChangeLog where ChangeLog.ObjectNumber = Staff.UidNumber AND Staff.LastName = 'kacoroski'
The above doesn't work so I am missing something fundamental here. Thanks for your help.
ski
Sub-query question
-
- Posts: 58
- Joined: Mon Nov 13, 2006 9:15 pm
- Location: Bothell, USA
-
- Posts: 595
- Joined: Sun Apr 24, 2005 2:22 am
- Contact:
The first version does not work because the condition "Staff.LastName = 'kacoroski'" does not relate to the object being searched. The subquery in the second version fixes this problem.
If you had a reference attribute to Staff in ChangeLog instead of the ID you would not need a subquery and could use a simple query like this:
FIND ChangeLog WHERE ChangeLog.Staff.LastName = 'kacoroski'
If you had a reference attribute to Staff in ChangeLog instead of the ID you would not need a subquery and could use a simple query like this:
FIND ChangeLog WHERE ChangeLog.Staff.LastName = 'kacoroski'
Aware IM Support Team
-
- Posts: 58
- Joined: Mon Nov 13, 2006 9:15 pm
- Location: Bothell, USA
ok, not sure how to make the reference attribute happen. Currently I have a rule like:
If Staff.LastName WAS CHANGED AND NOT(Staff IS NEW ) Then
CREATE ChangeLog WITH ChangeLog.Type='Modify',ChangeLog.ObjectNumber=Staff.UidNumber,ChangeLog.Message='LastName '+OLD_VALUE(Staff.LastName)+' changed to '+Staff.LastName
How would I add to this rule to insert the new ChangeLog into a reference attribute?
If Staff.LastName WAS CHANGED AND NOT(Staff IS NEW ) Then
CREATE ChangeLog WITH ChangeLog.Type='Modify',ChangeLog.ObjectNumber=Staff.UidNumber,ChangeLog.Message='LastName '+OLD_VALUE(Staff.LastName)+' changed to '+Staff.LastName
How would I add to this rule to insert the new ChangeLog into a reference attribute?
-
- Posts: 595
- Joined: Sun Apr 24, 2005 2:22 am
- Contact: