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
|
Hi Guys, I've been reading all posts regard to cascade delete, and didn't find the answer for our problem. What we have is parent table called Canvas which is referenced by Notices table through a nullable foreign key column (CanvasId). And both table a marked Soft Delete = true. What we want is upon calling Canvas.Delete, the children records in the Notices table has DeletedOn field populated (soft delete). The problem we had was only CanvasId is set to null and DeletedOn column is not populated. We've tried to set Is Dependent = true as suggested in this post DeletedOn is still null afterwards. Please advice... Cheers, Nathan |
|
|
Hi Nathan, I've tested using DependentAttribute with nullable soft deletes and it works okay for me... but there is a bug in the designer which means the Is Dependent setting is NOT working right now. The catch is that DependentAttribute needs to be applied to the foreign key field (the _canvasId field). When you set Is Dependent on an association, the designer emits the DependentAttribute onto the wrong field. There will be a fix for this in the next nightly build (8 Sept), or as a workaround you can suppress generation of the association and write the association members by hand, applying DependentAttribute to the _canvasId field where it belongs. Apologies for this bug -- please let us know if you still see the problem after upgrading to tomorrow's build. (Don't forget that you will need to force LightSpeed to regenerate the code after upgrading.) |
|
|
Hey man, it works like magic. You rock. We will upgrade to the nightly build tomorrow. |
|