StrataFrame Forum

Cascading Deletes and Updates

http://forum.strataframe.net/Topic30224.aspx

By Alex Luyando - 8/4/2011

Hi all.

Sorry, it's been a while since I've StrataFramed, so a bit rusty. Does SF support cascaded DELETEs/UPDATEs in parent-child relationships on maintenance forms without use of the DDT? If so, how is that controlled (i.e., how does one turn cascading on/off)?

TIA
By Edhy Rijo - 8/4/2011

Hi Alex,

Simply create a relationship in the database and set the RI cascade option there.
By Alex Luyando - 8/11/2011

Hi Edhy.

Thanks... sorry... I didn't put the qualification in my posting that the database cannot be altered so that's not an option. I see that the DDT allows for relating tables... does that actually persist the relationship back to the database or is the relationship kept at the "StrataFrame application" level?
By Edhy Rijo - 8/11/2011

Alex Luyando (8/11/2011)
I see that the DDT allows for relating tables... does that actually persist the relationship back to the database or is the relationship kept at the "StrataFrame application" level?

Hi Alex,

I understand, but anything you do in the DDT will basically persist in the database, not the SF Business Object, so if you don't have access to modify the database, then you will have to handle the cascade delete on your own.  There are many ways to do this based on the level of validation you may need to do before deleting, but if no validation is required, instead of looping each child record, create a SQL command to delete all record for a particular FK value and use the BO.ExecuteScalar() to get the number of records deleted and then delete the parent record.