There are two Client Actions that you can use in your application:
CNPJValidation: Used to validate the CNPJ number by calculating the verification digits. Note that this function already removes the mask, so it is not necessary to strip mask characters before calling the Client Action.
FormatCNPJ: Used to apply the mask to text inputs in your form. In your application, you should call this Client Action within a Screen Action associated with the "onkeyup" or "onkeydown" events.
On any page where you use "CNPJValidation", you must include the block to inject the JavaScript library code, just as you would when adding a "Required Script" to your page.