문제

How can I set multiple values in taxonomy field using client model? For single value I use follow snippet:

    var item = ctx
    .get_web()
    .get_lists()
    .getByTitle('News')
    .getItemById($("#newsId").val());

    var newTag = "40;#term_title|cd1df680-fff6-4d37-a336-95a2fbc0719d";

    item.set_item("NewsTag", newTag);
    item.update();

    ctx.executeQueryAsync(function () {
    }); 

it works fine for single value.

I have tried to use newTag variable as array and tryed to concatenate two strings {id};#{title}|{guid} with ; separator but it does not work.

Can anyone help with that?

도움이 되었습니까?

해결책

I've found out the right way to set multiple values. Actually the delimiter is combination of semicolon and sharp ";#" not just a semicolon ";"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top