Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Only One-Time feature Activation

  Asked By: Darci    Date: Dec 19    Category: Sharepoint    Views: 1048

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



2 Answers Found

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

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

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

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.