Skip to main content

Is there a good way to check whether an occurrence is deletable (i.e. check its relationship constraints), without having to change the code manually any time a new constraint is added?

We are currently getting error messages in our server log files, indicating that the record cannot be deleted because there is a 'down' entity with the restriction on delete. 

There are other down entities with cascade or nullify relationships, so simply checking whether any of them have data (using INNERENTITIES on a loop) won't do it unless we can also find their relationship status in proc code. 

Thanks 

Iain

Is there a good way to check whether an occurrence is deletable (i.e. check its relationship constraints), without having to change the code manually any time a new constraint is added?

We are currently getting error messages in our server log files, indicating that the record cannot be deleted because there is a 'down' entity with the restriction on delete. 

There are other down entities with cascade or nullify relationships, so simply checking whether any of them have data (using INNERENTITIES on a loop) won't do it unless we can also find their relationship status in proc code. 

Thanks 

Iain

Simple and good way?
Let's think about it: No 🙂
Long time ago, a colleague of mine wrote a "generator" which creates to each table defined in UnifAce a "technical services". You ask this service if you can delete a row, then this services - as it knows from generating and using UCREF&Co - check every referenced table by calling recursiv its services.

There a two advanteges

  1. You don't need all tables in your component.
  2. You can add your own logic

Two drawbacks

  1. You have to write and maintain this services
  2. As the services don't have the "Overview", you could end in a kind of deadlock when some tables/row mutually depends to each other.

But as the colleague leave long time ago, we don't use this thing anymore.

Ingo