2017-08-05 6 views
0

SharePointのSP-PNP-jsからクリア/空のマルチユーザー・フィールド(<a href="https://github.com/SharePoint/PnP-JS-Core/wiki/Working-With:-Items" rel="nofollow noreferrer">https://github.com/SharePoint/PnP-JS-Core/wiki/Working-With:-Items</a>)ここで提供されている例を見てみると

私はそれがクリアされないマルチユーザー・フィールド(更新)をクリアしようとしていました。私は何が欠けていますか?私はそれをヌルに設定しようとしましたか、空の配列が両方とも不正な要求で失敗しました。

答えて

0

ユーザフィールド値の場合、フィールド名は<UserFieldName>Idと参照する必要があります。たとえば、CurrentApproverという名前のフィールドの場合、フィールドはCurrentApproverIdと参照される必要があります。これはおそらく、あなたのケースでユーザーフィールド値が更新中に無視される理由です。

は例

pnp.sp.web 
.lists.getByTitle('Agreements') 
.items.getById(agreement.Id) 
.update({ 
    Notes: 'Notes go here..', 
    // Clear Multi User Approver Field. 
    CurrentApproverId: { results: [] }, 
}) 
.then((result) => { 
    resolve({ result: true }); 
}).catch((e) => { 
    console.log(e); 
}); 
+1

後半の応答をねえ、申し訳ありませんを更新しました。はい、ありがとうございました。 –

関連する問題

 関連する問題