Validate Asset number using Sharepoint column validation

In our organization asset numbers are printed in these formats:
03 XXXX
03 XXXXX
77 XXXX
77 XXXXX

A need arised to fill those numbers into sharepoint (printer toner consumption app), but without the space at the 3 place.

This is the validation formula for that:

=KDYŽ((JE.CHYBHODN(NAJÍT(” “;[Výdej pro HIM]))); KDYŽ(DÉLKA([Výdej pro HIM])>5; KDYŽ(JE.ČISLO([Výdej pro HIM]+0); KDYŽ(ZLEVA([Výdej pro HIM];2)=”03″; 1; ZLEVA([Výdej pro HIM];2)=”77”) ;0) ;0) ;0)

which translates into:


if input does not contain space then
if length of input is > 5 then
if input IsNumber then
if two leftmost charecters="03" then
return true
else
if two leftmost charecters="77"
return true
else
return false
else return false
else return false
else return false

Advertisements

Tagged:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

smsagent

Tips, tricks and time-savers for the Windows and ConfigMgr administrator

To The Point

Anything about Technology and Business

Brian's Power Windows Blog

Microsoft in the Enterprise. Windows, Hyper-V, Exchange, SQL, and more!

PowerScripting Podcast

Shownotes and links for the PowerScripting Podcast, a podcast to help people learn Windows Powershell

Learn Powershell | Achieve More

What is this Powershell of which you speak?

%d bloggers like this: