0

In SharePoint 2013 on-premise I am trying to create a Person or Group field to use it in a content type. My problem with the field is that I cannot select more than 1 person. I have been googling a lot, and all posts say that it should be sufficient to set Mult="TRUE", and Type="UserMulti". I have done it, and tested it several times, it doesn't work. This is how my XML looks like:

  <Field ID="{7BDBB321-E55F-55G6-1082-61029C0997G1}" 
         StaticName="xxx_test"
         Name="xxx_test"
         DisplayName="Test Delete"
         Group="XXX"
         Type="UserMulti"  
         List="UserInfo" 
         Required="FALSE" 
         EnforceUniqueValues="FALSE" 
         ShowField="ImnName" 
         UserSelectionMode="PeopleOnly" 
         UserSelectionScope="0" 
         Mult="TRUE" 
         Sortable="FALSE"  />

Please advice.

  • 1
    Deploy your solution and check the settings for the field. Is "Allow multiple selections" set to Yes? If not, your solution may not be deploying correctly. – Submits Apr 14 '16 at 11:38
  • It's set to no. I'll inspect my script for deploying fields. Thanks for the tips. – Ilyas Apr 14 '16 at 11:40
  • I am using powershell to create fields: $FieldCollection = $site.RootWeb.Fields $FieldCollection.AddFieldAsXml($FieldXmlElement.OuterXml) can't see the problem with that. All other properties gets set correctly. – Ilyas Apr 14 '16 at 12:21
  • Was your field deployed previously ? You could try to add Overwrite="TRUE" to overwrite the field definition – JayHell Apr 14 '16 at 12:39
  • I deleted the field completely and re deployed, and tried it on another site collection also. "Ghosting" is not the problem. The problem is in my xml and powershell, but I have not yet found what it is. – Ilyas Apr 18 '16 at 13:06
1

Note that all fields properties that have a return type of boolean, are set binarily (i.e. 1 = true, 0 = false). I would recommend looking at the return types of each of the properties you are trying to set on MSDN, SP Field Properties.

It looks to me as though all your Boolean values are being incorrectly set. Set thusly;

<Field ID="{7BDBB321-E55F-55G6-1082-61029C0997G1}" 
     StaticName="xxx_test"
     Name="xxx_test"
     DisplayName="Test Delete"
     Group="XXX"
     Type="UserMulti"  
     List="UserInfo" 
     Required="0" 
     EnforceUniqueValues="0" 
     ShowField="ImnName" 
     UserSelectionMode="PeopleOnly" 
     UserSelectionScope="0" 
     Mult="1" 
     Sortable="1"  />

Hope this helps

  • That was a good idea, but sadly didn't do the trick. – Ilyas Apr 18 '16 at 13:11
  • If you have the code that you are using to process your XML, that may be helpful. It may well be an issue with your code rather than the XML. Doing this myself, it was written all in PowerShell for instance. – George Grainger Apr 18 '16 at 13:14
  • I am using AddFieldAsXml, and adding the xml; $FieldCollection = $site.RootWeb.Fields $FieldCollection.AddFieldAsXml($FieldXmlElement.OuterXml) – Ilyas Apr 18 '16 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.