Determining if child records are created

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
kklosson
Posts: 1646
Joined: Sun Nov 23, 2008 3:19 pm
Location: Virginia

Determining if child records are created

Post by kklosson »

I'll use a metaphor:

During the creation of a supervisor object, the user can select one or more existing employees (peers) to assign to the supervisor. As a rule on the Supervisor, I want to determine whether any employees have been assigned and if so, send an email notification to each. I can't figure it out any syntax that works.

Not workable but expresses the idea:
IF EXISTS Employee IN Supervisor.Employees THEN

Since the object may not be committed to the database at this point, I am unsure if this is feasible. It's probably really easy like all things in AIM and I'm just over thinking it.
V8.8
MySQL, AWS EC2, S3
PDFtk Toolkit
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Determining if child records are created

Post by tford »

Sounds like you want to check if the Supervisor instance IS NEW + if Supervisor.Employees IS DEFINED.

If both of these conditions exist, you want to find the Employees in Supervisor.Employees and send email the email.
Tom - V8.8 build 3137 - MySql / PostGres
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Determining if child records are created

Post by idpSteve »

Perhaps try

IF EXISTS Employee WHERE Employee IN Supervisor.Employees THEN
Post Reply