Pergunta

I have a document library with document sets in it. Each document set represents a project.

On the welcome page of each document set I want to show a tasks list (in Gantt chart view) that will be that project's project schedule.

There are 3 things that need to be done here:

  1. Create a new tasks list when a new document set is created - I know how to do this.
  2. Edit the default document set home page so a tasks list is shown on the page - I know how to do this.
  3. The tasks list web part on the document set home page should dynamically point to the newly created tasks list as soon as the document set is created - how do I do this?

Follow-up:

What if I want every document set (i.e. every project) to have its own tasks list, risks list, site feed, etc. - is this even possible?

Foi útil?

Solução

I don't know how many projects will be created throughout the span of your application or the background of your requirement , but i would suggest an alternative plan of considering to make your Project as a sub site instead of Document Set, since you need a separate task list,risk list, site feed etc for each project.

So alternative way would be :

  1. Create a site template with all the lists/libraries/welcome page/site feed etc you need.
  2. Configure welcome page to show Task list of the sub site.
  3. Create sub sites for each project with those site template.

Advantages:

  1. You can use OOTB features to achieve your task 1,2 & 3.
  2. Site feed web part will show only feed for that specific sub-site.
  3. Better isolation of project data.

This will give you a lot flexibility to build your application.

Outras dicas

I doubt if it would be possible to do so if you want to use the out-of-the-box webparts. If I would have to solve something like this a the moment, I would build a small AngularJS app, add that app to the document set page and call the rest endpoint of the task list(s) to get the data. Depending on the context of the Angular app you could set a filter on the rest call, or you can go to a specific url.

For the last option you could, for example, add a property to the document set with the relevant url of the task list.

Another option might be updating the webpart properties of the task list on the document set page on page load. I don't know if this would actually work, since it is not rendered on the client side. If you want to try this approach, this is a good starting point: http://almondlabs.com/blog/update-web-part-properties-csom/

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top