This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello I have an TypeA entity that is not allowed to be deleted if it's being referenced by any TypeB or TypeC entities. Right now I just count the TypeB and TypeC entities using TypeA. I was just wondering if Lightspeed (being so intelligent as it is :-) could provide help in this scenario. Is it possible to ask Lightspeed to fail if I delete a TypeA entity that is being referenced by any TypeB or TypeC entities? Is it possible to query Lightspeed about how many entities would be cascade deleted as a result of deleting a TypeA entity? Regards Bjarne (Lightspeed version 4.0.1173.19866) |
|
|
Yes - change each association from TypeA and set the removal behavior to "NoAction". If there are any children for that association being deleted then LightSpeed will raise an exception.
No, there isn't a way of "asking" how many entities would be affected by a given delete operation.
|
|
|
Hi Jeremy OK, thanks :-) |
|
|
Hi Jeremy, I have a similar situation and I set the Association's Removal Behaviour to "NoAction" However the exception message is not very helpful: "FATAL Removal behavior specifies no action, but this entity has children" Is there any way to get something better like: "Cannot delete record as it has dependencies" or some such thing? Ta - Imtiaz |
|
|
Ive updated this to be: Cannot remove entity as it has dependencies but the removal behavior has been specified as NoAction. We want to retain a clear indication that you have specified NoAction as a removal behavior as this is the reason for the failure.
|
|