Usually what I do is create a delete method for that object that looks in all possible related rules for itself and removes it from them. Then at the end of the method run a super.delete().
I've requested to have FarCry be able to do this in the past (because I end up writing this for pretty much every custom type on every FarCry project). The request is a bit old and still in Jira I believe. It would be fairly easy for FarCry to be able to do it. All it would need is a simple list of the rule names associated to that object to look in and do a cleanup (there are probably a few other ways to do it as well). -- Jeff Coughlin On Sep 20, 2012, at 11:09 PM, Xiaofeng Liu <[email protected]> wrote: > Hi folks, > > I got a question about the deletion of content type items from within FarCry > webtop. > > Say I have two custom content types 'Questions' and 'Tests'. A test is linked > to an array of questions so in the tests.cfc I have a property > > <cfproperty ftSeq="02" type="array" name="aQuestions" ftType="array" > ftJoin="questions" ftAllowEdit="true"> > > Now I have used FarCry scaffolding which generated two admin interfaces > within the farcry web top which allowed me to manage questions and tests > separately with the FarCry default list and edit views. > > The list view got buttons like Add, Delete, Unlock etc. Now my problem is if > I delete a question which has been used by a test from the question list > view, FarCry doesn't seem to prompt me that the question is currently used by > a test. As a result, in the corresponding test details view, the selected > question became 'Object Not Found'. > > I'm just wondering what's the best way to handle this? I can manage to hide > the 'delete' button from the scaffolded views but I just want to know does > this sound a bit odd or is there any way I can customize the delete action so > that I can do a check to see whether or not there are content items exist in > the join table and if yes prompt user a warning message? > > > -- > Best regards, > > Xiaofeng,^_^ > > -- > You received this message cos you are subscribed to "farcry-dev" Google group. > To post, email: [email protected] > To unsubscribe, email: [email protected] > For more options: http://groups.google.com/group/farcry-dev > -------------------------------- > Follow us on Twitter: http://twitter.com/farcry > > -- You received this message cos you are subscribed to "farcry-dev" Google group. To post, email: [email protected] To unsubscribe, email: [email protected] For more options: http://groups.google.com/group/farcry-dev -------------------------------- Follow us on Twitter: http://twitter.com/farcry
