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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesRemove data of any module using ModuleId.Remove data of any module using ModuleId.
Previous
 
Next
New Post
10/15/2012 2:53 AM
 
Hello Friends,

I am exploring DNN module development and for that I used sample module TaskManager.

This module is adding task for modules with unique ModuleId (A module which is placed on different page). Now I want to remove tasks for that module when I am removing that module from any page.

DNN is not allowing me to create relationship of TaskManager table with "Modules" table in database.

Can you please suggest me, what can be the possible solution for this. How can I track removal of any module from any page so that I can remove any task or other material related to that module.

Thanks in advance.

Regards,

Namrata Mathur

 
New Post
10/15/2012 6:45 AM
 
Hi Namrate,

This is handeld by the sqldataprovider of your developed module. Here http://www.dotnetnuke.com/Resources/B... you can find all sorts of documentation about module devlopment.

Regards.

Martijn Goedings
 
New Post
10/15/2012 9:07 AM
 

Hi Martijn,

Thanks for reply and your suggestion. But using sqldataprovider will only remove those tasks, when I will uninstall the module. Here I want to remove them at the time of removal/deletion of any module instance from any page.

Please suggest how can I do that. 

Thanks again !

Regards,

Namrata Mathur


 
New Post
10/15/2012 9:12 AM
 
your module may place a foreign key on the modules table with cascading delete.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
10/15/2012 9:23 AM
 

Namrata,

You are correct that the uninstall sql script will only remove a custom module's data upon uninstallation of the module, not deletion of a module instance from a page.

Although I don't consider it the best practice, most module developers including myself out of necessity must set up a foreign key relationship (with cascade delete enabled) between the module's custom table's ModuleID column and the ModuleID column of the core Modules table. Note that your custom table's ModuleID column must be set to not allow nulls. Other than that, I'm not sure why you were unable to set up the FK relationship.

Even with this approach note that data for a particular ModuleID will not be deleted until all reference instances of the module are removed from all site pages AND are removed from the recycle bin.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesRemove data of any module using ModuleId.Remove data of any module using ModuleId.


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