site columns - Field type number

Hi,

How to create a number column (in elements.xml) which can take a maximum of 5 digits?

I have tried this, but it is not getting restricted to 5 digits.

<Field Type="Number" DisplayName="New Number" Required="FALSE" MaxLength="5" EnforceUniqueValues="FALSE" Indexed="FALSE"   ID="{GUID}" StaticName="GNewNumber" Name="GNewNumber" />

How to create a number field which takes a maximum of 5 digits using elements.xml.

Thanks

August 19th, 2015 9:06am

hi

set Max = "99999" and Min = "10000"

<Field Type="Number" DisplayName="New Number" Required="FALSE" Max="99999" Min="10000" EnforceUniqueValues="FALSE" Indexed="FALSE"   ID="{GUID}" StaticName="GNewNumber" Name="GNewNumber" />


Free Windows Admin Tool Kit Click here and download it now
August 19th, 2015 9:17am

HI,

Thanks for the reply.

what does Max and Min mean? If Min is kept as "10000", can users still enter 01234?

Thanks

August 19th, 2015 11:04am

Min - The minimum value allowed for the value

Max - The maximum value allowed for the value. 

If user enters 01234, it will not accept in this case. 

Free Windows Admin Tool Kit Click here and download it now
August 19th, 2015 12:20pm

in number fileds if you enter 01234, it will save as
August 19th, 2015 1:22pm

Hi,

I have tried this:

<Field Type="Number" DisplayName="New Number" Max="99999" Min="10000" Required="FALSE" MaxLength="5" EnforceUniqueValues="FALSE" Indexed="FALSE"   ID="{GUID}" StaticName="GNNumber" Name="GNNumber"  />

But this is not restricting 5 digits. Users are able to enter more than 5 digits in the column.

How to fix this?

Thanks

Free Windows Admin Tool Kit Click here and download it now
August 20th, 2015 12:12pm

Hi Venkat,

 If this is not working, you may have to construct formula to validate the number of digits. Please follow the below referenced links. 

http://www.ilikesharepoint.de/2012/02/sharepoint-2010-create-and-validate-a-number-field-in-a-list-without-thousand-separator/

https://social.technet.microsoft.com/Forums/sharepoint/en-US/4688b6ff-83b4-4935-adb8-da01675368b9/how-to-validate-enter-only-numbers-with-fixed-length-to-text-field?forum=sharepointgenerallegacy

August 20th, 2015 1:29pm

Hi,

I tried this, but got an error page:

=IF(Len[Field]=5,True,False)

How to set the validation?

Free Windows Admin Tool Kit Click here and download it now
August 20th, 2015 2:32pm

What is the error msg you got it?
August 20th, 2015 4:26pm

Hi Venkatzeus,

Any update?

Thanks,

Patrick Liang

Free Windows Admin Tool Kit Click here and download it now
September 1st, 2015 10:47pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics