redundant instance deletion

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:

redundant instance deletion

Post by tkilshaw »

Object Account has reference attribute to a Task called NextContact, a unidirectional peer 1to1 relation.

Account also has reference attribute Tasks, a bidirectional 1tomany peer relation to Tasks.

When a new Account is created a new Task is also made and set in NextContact and Tasks.

Because Tasks can exist independantly from Accounts the relations must be peer.

If the user clicks the Cancel key on the Account form, before the account is created, I am left with a redundant Task record.

How can this be found and deleted?

thanks,

Terry
greg
Posts: 124
Joined: Sat Apr 23, 2005 12:46 am

Post by greg »

Hi Terry,

If my experience is of any help, I ran into similar problem with PurchaseOrder and OrderItem objects. I added a time stamp to OrderItem and a reference attribute MyOrder. Then I scheduled this process:

rule1: FIND ItemOrder WHERE ItemOrder.MyOrder IS UNDEFINED AND DAY_DIFFERENCE(CURRENT_DATE,ItemOrder.TimeStamp)>=1

rule 2: DELETE ItemOrder

works fine
tkilshaw
Posts: 170
Joined: Thu Jan 19, 2006 11:33 pm
Location: Western Canada
Contact:

Post by tkilshaw »

Thanks Greg. How often do you run that process?

Seems like the language needs better support for this kind of thing.

Terry
greg
Posts: 124
Joined: Sat Apr 23, 2005 12:46 am

Post by greg »

I run it every night. I also find and cull some other unattached objects.
Post Reply