function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Remove Dashes from ID

I currently have a text field that is used to contain a 10-digit numeric expression (ex. 1234567890).  However, the number is often copied and pasted from another program with dashes in the format (ex. 123-456-7890).  I currently have the field being available for 12 characters, using a validation rule that only allows for 10 characters, forcing the user to manually remove the two dashes.  How can I keep it so the user can paste the 12-digit number, but when it is saved, it only saves in the 10-digit format that I need for reporting?


A trigger can serve your purpose or may be you can have a formula field which stores the id after stripping the dashes if they are included in the input.

You can refer to this formula field in your report.



Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.




change field to length of 12 and then write worklow where condition is


LEN equal to 12 and then update the same number field with Concatenate ( Left (3)  Mid(3) and then Right (4))


Make sure field type is text