使用PNP / SP在代码中对SharePoint查找字段进行多重选择

时间:2018-12-10 15:35:49

标签: javascript typescript spfx

我正在尝试创建一个查找字段,以允许进行多种选择:

ler.list.fields.inBatch(batchCreate).createFieldAsXml(`<Field Name="${strings.Committees}" DisplayName="${strings.Committees}" Type="Lookup" List="{${lookupID}}" ShowField="Title" AllowMultipleVaues="true"/>`);  

1 个答案:

答案 0 :(得分:1)

使用Type="LookupMulti",而不是AllowMultipleVaues="TRUE"使用Mult="TRUE"

<Field Name="${strings.Committees}" DisplayName="${strings.Committees}" Type="LookupMulti" List="{${lookupID}}" ShowField="Title" Mult="TRUE" />

https://docs.microsoft.com/en-us/sharepoint/dev/schema/field-element-field