Cascading Deletes and Updates


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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.

Edhy Rijo

Alex Luyando
Alex Luyando
StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)
Group: StrataFrame Users
Posts: 112, Visits: 1.2K
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?

________________
_____/ Regards,
____/ al
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Alex,

Simply create a relationship in the database and set the RI cascade option there.

Edhy Rijo

Alex Luyando
Alex Luyando
StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)
Group: StrataFrame Users
Posts: 112, Visits: 1.2K
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

________________
_____/ Regards,
____/ al
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search