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

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Getting module ID while the module is installingGetting module ID while the module is installing
Previous
 
Next
New Post
4/1/2008 12:33 PM
 

 

I have a requirement to insert some master data into a table when the module is installed. The master data is supposed to have the module ID also. How do I get the module ID of the module (currently being installed) in the SQL scripts? Is there any token which can be used?

 
New Post
4/1/2008 6:36 PM
 

The short answer is that you can't because a ModuleId is not assigned until an installed module is added to a page of the site. In some cases I have pre-populated tables with installation wide (not module specific) values signified by either a bit data  "Global" column or a -1 in the table's ModuleId column.

In most cases, however, module specific data should be added to table(s) when a module is accessed for the first time after being placed on a page. If the module makes use of one or more ModuleSettings, your code can recognize that it is being accessed for the first time if the module's Settings object is empty or you can define a specific Setting key/value to signifiy that the module's data has been previously initialized.

Another approach for "global" data is to key that to either the DesktopModuleId or ModuleDefinitionId as appropriate. These can be obtained in your implementation of the IUpgradable interface in your business controller class. The implementation's UpgradeModule method will be called once for each SQL dataprovider file version greater than the currently installed version which makes it the best place for version specific code to be run during installation.


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
 
New Post
4/5/2008 8:44 AM
 

Thanks for your suggestions.

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Getting module ID while the module is installingGetting module ID while the module is installing


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