Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Only One-Time feature Activation

  Asked By: Darci Knowles         Date: Dec 19, 2009      Category: Sharepoint      Views: 204
 

i have deployed a solution with 3 features now i am stuck with a task that i
want one of my features to be activated only once. After De-Activation the user
must not be able to activate the feature again. because re-activation will
overwrite data which is a critical issue. Is there any solution to this
problems.

Tagged:          

 

2 Answers Found

 
Answer #1       Answered By: Nisha Gadre          Answered On: Dec 19, 2009       

There's nothing out of the box that will do this. You would need to
associate a feature  Receiver with the Feature and then in the Deactivating
event code write a flag somewhere that you could check in the Activated
event code. Your biggest problem will be that Feature's don't have an
Activating event, only an Activated event. So you will probably have to
restructure your feature to create whatever needs to be created in the
Activated event, so you can check the flag before building or overwriting
something.

 
Answer #2       Answered By: Chirag Gupte          Answered On: Dec 19, 2009       

You may have to write a Feature Receiver with a Feature Deactivating
event to capture this. Please check.

 
Didn't find what you were looking for? Find more on Only One-Time feature Activation Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].