conditional list remove

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
tkilshaw
Posts: 170
Joined: Thu Jan 19, 2006 11:33 pm
Location: Western Canada
Contact:

conditional list remove

Post by tkilshaw »

Object Account has attribute Contacts, a one to many peer relation. Object Contact has matching attribute Accounts.

Account MainContact is a one to one reference to a Contact. It has no matching attribute in Contact.

When a Main Contact is added to Account.MainContact it is also inserted into Account.Contacts.

On the Account's form there is a separate form section that displays the list of Contacts. When a user trys to remove a Contact from that list, if the Contact they are trying to revove is actually the Account's MainContact I want to tell the user that they can't do that. But if the Contact they are trying to remove from the Account's contact list is not the Account's main contact, I just want to remove it from that list.

This should be easy to do, I think, but I have not been able to do it.

I can unconditionally remove the Contact from the list, but I can't do it conditionally, and I have tried all sorts of things.

Any suggestions?

Thanks,

Terry
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Terry,

You can add the following rule to Account:

If Contact WAS REMOVED FROM Account.Contacts AND RemovedContact = Account.MainContact Then
REPORT ERROR 'Main contact for the account cannot be removed from contact list.'
Aware IM Support Team
tkilshaw
Posts: 170
Joined: Thu Jan 19, 2006 11:33 pm
Location: Western Canada
Contact:

Post by tkilshaw »

Your suggestion worked. Thanks.

And I thought I was beginning to understand this mechanism but the following rule does not work:

If Contact WAS REMOVED FROM Account.MainContact Then
Remove RemovedContact FROM Account.Contacts

And I don't understand why.

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

Post by aware_support »

This is a bug that will be fixed in the next build.
Aware IM Support Team
tkilshaw
Posts: 170
Joined: Thu Jan 19, 2006 11:33 pm
Location: Western Canada
Contact:

Post by tkilshaw »

Hopefully that will make it into the next beta too, as I'm now developing in the beta.

Let me know when I can get it. Thanks,

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

Post by aware_support »

This is fixed starting from build 777.

(everything that goes into the main version goes into beta as well).
Aware IM Support Team
Post Reply