- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 11:56 AM
I need to insert formatting in a field on the workspace form.
The field must follow the format 00.000.000/0000-00.
I managed to make it work in the Catalog Item, but it doesn't work in the workspace.
How can I insert this formatting in the workspace?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 10:00 PM
I see. Thanks for the recording.
getControl will not works in Workspace. And you will also face the same problem on the Portal.
You can find the error in the Browser Console.
Also Ref: KB0855260
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 12:09 AM
Let's try this approach.
1. Define a Variable Validation Regex.
Sample below
^[0-9]{2}(?:.[0-9]{3})(?:.[0-9]{3})\/[0-9]{4}(?:-[0-9]{2})?$
2. In your Producer Variable at section Type Specifications, select the Validation Regex as CPF (from step 1).
Enjoy the result.
Let me know if it works for you.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 05:44 AM
Hi @Tai Vu, thank you for your response.
The Validate Regex application works well, but what I require is for the formatting to be applied automatically as the user types, just like the example I demonstrated in this video.
To achieve this functionality, I've created three Catalog Client Scripts. Two of them are designed to validate fields, while the third one is intended to format them, as shown in the video. Here are the scripts I've created:
CNPJ field validation
CPF Field Validation
Formats CNPJ and CPF fields
The field validation scripts are functioning correctly, but the formatting script (the last one mentioned above) is not working as expected.
I would appreciate your guidance on how to apply this formatting to the workspace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 10:00 PM
I see. Thanks for the recording.
getControl will not works in Workspace. And you will also face the same problem on the Portal.
You can find the error in the Browser Console.
Also Ref: KB0855260
Cheers,
Tai Vu