Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Override method that is triggered on Recycle BinOverride method that is triggered on Recycle Bin's Permanent Delete?
Previous
 
Next
New Post
11/5/2009 5:23 PM
 

I was wondering how to go about triggering the deletion of SQL entries a module of mine is tied to after a module has been permanently deleted from the Recycle Bin. Is there an override method somewhere where I can put the code when a permanent delete occurs for a module?  I’m sure this must be a typical question that must come up when developing modules. Yet I can’t find anyone talking about it.

Thanks

 
New Post
11/5/2009 5:45 PM
 

Create the Uninstall.SqlDataProvider and write the scripts to clean up the database accordingly.

Look at the examples of the Uninstall.SqlDataProvider files in many of the downloadable modules.

 

 
New Post
11/5/2009 11:20 PM
 

Oh sorry I don't think I was very clear on what I was trying to do.  I'm not looking to write an SQL uninstall script when you uninstall a module.  What I meant was trying to figure out when a module is being deleted (ie. moving to the recycle bin and then clearing the recycle bin).  I need this because each module I drop onto a page creates entries into an SQL table, but when they are removed from a page permanently, there are left over data entries that point to nothing.  I'm trying to figure out where to put my code to remove the data entries that are tied to the module that is being deleted.  Anyone have any ideas?

Thanks

 
New Post
11/6/2009 9:56 PM
 

Ok Sorry I misunderstood.

I believe your talking about orphaned records in a SQL table.

Are you storing the ModuleId into your SQL tables?

If you are, you can follow the samples and place a cascading delete on the table so when a module is removed, all existances are also deleted.

ALTER TABLE {databaseOwner}[{objectQualifier}TABLENAME] WITH NOCHECK ADD CONSTRAINT [FK_{objectQualifier}TABLENAME_{objectQualifier}Modules] FOREIGN KEY([ModuleId]) REFERENCES {databaseOwner}[{objectQualifier}Modules] ([ModuleID]) ON DELETE CASCADE NOT FOR REPLICATION

Is this what you are asking about?

 
New Post
11/7/2009 1:35 AM
 

Ah yes this is exactly what I'm talking about.  Yes I am keeping track of the ModuleId. Now what I need is not how to write it out in SQL, but rather where in the world scripts are being triggered when a module is being removed. What I was hoping for was an override method or an event handler in the DNN framework that gets triggered when your remove an instance of a module.  I'm actually not using the DNN database for storing these module records, hence why I need something like an event to be triggered so I can customize the deletion of orphaned record.  Is there no such thing?

Thanks Ming.
 
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Override method that is triggered on Recycle BinOverride method that is triggered on Recycle Bin's Permanent Delete?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out