Question

I'm trying update list item created by workflow, using code below. But it did not work. What I am doing wrong?

public override void ItemUpdated(SPItemEventProperties properties)
        {
            base.ItemUpdated(properties);

        SPList Listcurrent = properties.Web.Lists["Tasks"];
        SPListItem taskid = Listcurrent.GetItemById(properties.ListItemId);

        taskid["%5Fx041d%5F%5Fx0430%5F%5Fx0437%5F%5Fx0432%5F%5Fx04"] = "Hello World!";               

         taskid.Update();

Any help would be appreciated!

Was it helpful?

Solution

The solution of update problem.

The code does not work whith field name "%5Fx041d%5F%5Fx0430%5F%5Fx0437%5F%5Fx0432%5F%5Fx04".

But"strange" name of the field is correct. The reason- russian letters in the field name.

To solve this problem decode field name to internal name. How to get it?

Go to this blog

And then decode field name in "URL Encoder And Decoder Tool" unit.

For me internal name is "_x041d__x0430__x0437__x0432__x04".

And new code will be, and it works:

taskid["_x041d__x0430__x0437__x0432__x04"] = "Hello World!";               

taskid.Update();
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top