Jump to content
Salesforce and other SMB Solutions are coming soon. ×

help with script numbermasking


peterpontiac
 Share

Recommended Posts

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

Link to comment
Share on other sites

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 by doughemi
Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use