update list item through workflow - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

update list item through workflow

Last post 09-15-2008 03:59 PM by Jamesliang. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 08-10-2008 12:21 AM

    • s42bm
    • Top 500 Contributor
    • Joined on 04-21-2008
    • Posts 32

    update list item through workflow

     Hi,

    I want to update some list items in a form library through workflowproperties. The list items are integrated from an InfoPath form. The code used in the workflow is as follows:

    SPWeb thisWeb = new SPSite(workflowProperties.SiteId).OpenWeb(workflowProperties.WebId);
    SPListItem thisItem = thisWeb.Lists[workflowProperties.ListId].GetItemById(workflowProperties.ItemId);
    thisItem.Properties["myProperty"] = workflowproperties.items["listProperty"] + an integer;
    thisItem.Update();

     During dubugging, the value of thisItem.Properties["myProperty"] was shown correctly, but the value shown on the form libray didn't change. Any idea? Help is appreciated!!

    Filed under: ,
  • 09-03-2008 02:19 AM In reply to

    Re: update list item through workflow

    thisItem.Properties are not properties of your workflow item. 
    Try this:
    workflowProperties.Item["myProperty"] = "blablabla";
    workflowProperties.Item.Update();
     
    SPWeb thisWeb = new SPSite(workflowProperties.SiteId).OpenWeb(workflowProperties.WebId);
    SPListItem thisItem = thisWeb.Lists[workflowProperties.ListId].GetItemById(workflowProperties.ItemId);
    thisItem.Properties["myProperty"] = workflowproperties.items["listProperty"] + an integer;
    thisItem.Update();
    Best regards,
    Alexander Ekzarov
    Kyiv, Ukraine
    silverlightnet.blogspot.com
  • 09-03-2008 12:35 PM In reply to

    • s42bm
    • Top 500 Contributor
    • Joined on 04-21-2008
    • Posts 32

    Re: update list item through workflow

    Thanks for the reply. I found out that I had to allow the change to the properties when the forms have been published to their host environment. But I’ll try your suggestion, see what difference it’d make.

  • 09-12-2008 10:38 AM In reply to

    Re: update list item through workflow

     s42bm.

      I have same problem, but I'm not use code, I used SP designer "update List Item" command, can you let me know how to change the properties when the form has been published. on where you can modify this

    parameter? my error message is "Event type : Error"; Description : error updateing at list item";"outcome:list item not found",

     

    Thanks

    Filed under:
  • 09-12-2008 12:34 PM In reply to

    • s42bm
    • Top 500 Contributor
    • Joined on 04-21-2008
    • Posts 32

    Re: update list item through workflow

     currently, I'm using the way suggested by ekzarov and it works fine.

     
    workflowProperties.Item["myProperty"] = "blablabla";
    workflowProperties.Item.Update();
     
    When you publish your form to a list, it asks you to choose the fields to be shown on that list. As you choose the item you want to update, click "Modify". Check the check box at the bottom saying "Allow user to edit data in this field by using a datasheet or property page". I
    hope this works for you. I never used the designer, so can't tell you what exactly the error message means. It seems tell you that the item was not found. Make sure the item name is correct and the ID chosen to locate the record is proper.
  • 09-12-2008 12:34 PM In reply to

    • s42bm
    • Top 500 Contributor
    • Joined on 04-21-2008
    • Posts 32

    Re: update list item through workflow

     

    currently, I'm using the way suggested by ekzarov and it works fine.

     
    workflowProperties.Item["myProperty"] = "blablabla";
    workflowProperties.Item.Update();
     
    When you publish your form to a list, it asks you to choose the fields to be shown on that list. As you choose the item you want to update, click "Modify". Check the check box 
    at the bottom saying "Allow user to edit data in this field by using a datasheet or property page". I hope this works for you. I never used the designer, so can't tell you what exactly 
    the error message means. It seems tell you that the item was not found. Make sure the item name is correct and the ID chosen to locate the record is proper.
  • 09-12-2008 02:10 PM In reply to

    Re: update list item through workflow

     s42bm.

      Thanks a lot, but can you let me know how to add code in SP Designer workflow . and my another question is when I republished , on MOSS, I can't open the form.

    system display "The form has been closed".

     

    Thanks

    Filed under:
  • 09-12-2008 06:54 PM In reply to

    • s42bm
    • Top 500 Contributor
    • Joined on 04-21-2008
    • Posts 32

    Re: update list item through workflow

    Please check out the following web site:

    http://blogs.msdn.com/sharepointdesigner/archive/2007/07/06/porting-sharepoint-designer-workflows-to-visual-studio.aspx

    It talks about how to edit a SPD workflow within VS and then deploy it. Also in the reviews at the bottom of the page, people

    mentioned problems they had during the process and how to solve it. Personally, I think it's easier to build a custom workflow

    directly in VS instead of transforming it from SPD. :)

    For the error occured, please check out

    1. The security setting of the form. It should be either domain or full trusted.

    2. The deployment files, such as feature.xml and workflow.xml. Because I never used SPD, I don't know if it has those files.

    3. Check out the log file for MOSS, you may find more details there.

  • 09-15-2008 03:59 PM In reply to

    Re: update list item through workflow

    Thanks a lot.

Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.