SharePoint ServiceObject Dynamic methods

  • 19 February 2009
  • 1 reply
  • 1 view

Badge +5

Greetings.  The OOB SharePoint ServiceObect has different 'types' of methods for lists/libraries.  To be more specific, if I look into an instance of my SharePoint ServiceObject and drill down to an 'Announcments' list, there are two 'Get List' methods:


Get List
Get List Dynamic


They both return the same properties and they both have the same inputs.  From a technical perspective, what is the difference between these two 'types' of  ServiceObject methods?


1 reply

Badge +10

Hi Eric


 


You’re correct that they return the same properties but the key difference is that the Get Dynamic List has an additional parameter to specify a SharePoint URL.  The Get List Dynamic method can then be utilized to reuse a SharePoint List SmartObject that can interact with a SharePoint List that doesn’t exist at design time (for example built from the same list template). 


 


Scenario where this was required:


A Request For Proposal process where as part of the K2 process a SharePoint Team Site is automatically created for each RFP process instance.  Within the SharePoint site we needed to be able to allow the business owner to add/remove users to a SharePoint List which was used to determine the destination users for an activity at a later stage in the RFP process.  We couldn’t use K2 Roles since each RFP would typically have completely different people working on it and creating temporary AD groups for each RFP process would be unmanageable for IT).


 


The solution was to


·         Create the Sharepoint Site and a Custom List which would contain the RFP members.


·          Created the SharePoint List SmartObject against that Custom List


·         Added that SharePoint site as a site template


·         Use the K2 SharePoint Sites and Workspaces event to automatically create the SharePoint Site as a step within the process and store the URL of the site in a datafield.


·          In the Activity which needed to be assigned to the users that were added to the SharePoint List I assigned the destination user to the List SmartObject Get List Dynamic method and used SharePoint URL datafield to the populate the SharePoint URL Parameter.


 


 


I hope this helps.


Regards,


Tim

Reply