peterpontiac Posted December 2, 2016 Share Posted December 2, 2016 Hi everyone, I us this script for masking my originalnumber with periods. ---------------------- Let( C = Filter( Origineelnr.; "0123456789" ); If( Length© = 10; Left( C; 1 ) & "." & Middle( C; 2; 3 ) & "." & Middle( C; 5; 3 ) & "." & Middle( C; 8; 3 ); "Invalid Entry" ) ) --------------------------- When the numberlenght is NOT 10 "Invalid entry" will appear. What I want: When typing a number which is not 10 characters I want it to leave it that way. - So when I type 0123456789 the number displayed will be 0.123.456.789 - When I type 987654321 the number will be the same as entered - When I type D6RA63 the number will be the same as entered. Thanks, Peter Quote Link to comment Share on other sites More sharing options...
doughemi Posted December 2, 2016 Share Posted December 2, 2016 (edited) Just change "invalid Entry" to Origineelnr. But instead of a script, why not use an auto entered calculation in the origineelnr field: Let( C = Filter( self; "0123456789" ); Case( Length(C) = 10; Left( C; 1 ) & "." & Middle( C; 2; 3 ) & "." & Middle( C; 5; 3 ) & "." & Middle( C; 8; 3 ); self ) ) Using Case( ) in a calculation is easier to read later on, and also is easier to modify in the event more specific changes are needed in the field. Edited December 2, 2016 by doughemi Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.