pmrh
Novice

can I read sharepoint list item values from a workflow?

It is possible to build a workflow that loops a sharepoint list, to check item by item, a metatag value for comparing?

When using Sharepoint List Event I have:
K2SPSList SpsList = new K2SPSList();
SpsList.Url = Server + "_vti_bin/K2SpsList.asmx";
and methods like
SpsList.CreateListItem(Site, ListName, strXml, ref ListItemId, ref ErrorMessage) or
SpsList.GetListFields(Site, ListName, ref ErrorMessage)

But is it possible, in any way, get the values of that fields of a certain item?

Thank you.
0 Kudos
Reply
4 Replies
Marc
Novice

Re: can I read sharepoint list item values from a workflow?

*bump*

I have the same question. anyone?
0 Kudos
Reply
VTJamie
Novice

Re: can I read sharepoint list item values from a workflow?

bump
0 Kudos
Reply
Bob
Apprentice

Re: can I read sharepoint list item values from a workflow?

You may be interested in look at this How-To post:


http://k2underground.com/forums/thread/17389.aspx


It deals specifically with programatically retrieving  List Item values that contain user IDs and using as destinations for an activity, but that being said, it does show how I was able to programmatically retrieve list item values from within K2.  FYI, this was done with Sharepoint 2003.


HTH.


 

0 Kudos
Reply
elizas1
Novice

Re: can I read sharepoint list item values from a workflow?













For each item in a SharePoint list,an ID is associated with it.This ID is automatically generated when we add a List item. It is easy to get the item id after the item is added(either programtically or by viewing the ID column of the list).But how to get the ID of the item before the item is added to the list ?

Here is a solution to this problem.




public static int NextListItemID(SPSite oSite, Guid listId)
{
      int listItemId = -1;

      Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(delegate()
        {
                 if (oSite.WebApplication.ContentDatabases.Count > 0)
                 {
                   //Get the connection string for the sharepoint database
                            string connString = oSite.WebApplication.ContentDatabases[0].DatabaseConnectionString;
   
                           //Establish a connection
            SqlConnection con = new SqlConnection(connString);

 

                           try
                           {
                                 con.Open();



0 Kudos
Reply