0

I have a site collection column named “Sub site Manager” which is associated with a security group named “Site Admis”. And inside our sub sites list, users select the related admin user when create/edit a list item.

Now we got the following new requirement from our customer, that when creating a new sub site we need to be able to set the default value for the “Sub Site Manager”.

So the scenario will be something such as:-

  1. User clicks on create new sub site.
  2. Enter the subsite; title, URL , template and then select a “Sub site Manager” user. create the subsite.
  3. after that the selected user should be the default user for the "Sub site manager" column.
  4. and when we create a new list item the "sub site manager" field should have the default value that have been set during the subsite creation.

I search for how I can manage this but did not find a way? So can anyone advice on this please?

1

For achieving your requirement

  1. You should create one list with column like title,url,template, Sub site Manager
  2. You should create web level feature which provision your "Sub Site Manager" field(Note that scope will be web, otherwise it will create site collection level column)
  3. You should bind "Item Added" event receiver column to that list and following should be business logic for event receiver

3.1. Now in "Item Added" event receiver create site using given template in list template

3.2. Now create SharePoint group with unique name and add it add users added in list item in field Sub Site Manager

3.3. Activate feature which you have created for provisioning user field

3.3. Now set newly created group to user field ie. Sub site manager

You will easily find help in coding to achieve above requirement

Hope it will help you.

  • thanks for the reply, so you mean first of all i need to create a list at the site collection level, which will store the subsite's title, url, etc ... , then using a web level feature it will populate the list when a sub site got created. but how will sub site creator enter the "sub site manager " when creating the subsite ? not sure i got exactly how i will be doing these things,, also how i will define the entered "sub site manager" to be the defualt values for the column inside the item list ? – john Gu Jun 2 '15 at 13:58
  • 1
    No. I think you misunderstood it. Using web level future you need to provision SharePoint field of type User for storing sub site manager – Kalpesh Vaghela Jun 2 '15 at 14:58
  • and how i will be storing the subsite manager ? in this case? – john Gu Jun 2 '15 at 15:49
  • Point#3.3 gives your answer – Kalpesh Vaghela Jun 3 '15 at 3:35
  • Sorry. your answer is in Point#3.2 – Kalpesh Vaghela Jun 3 '15 at 3:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.