문제

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!

도움이 되었습니까?

해결책

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();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top