zip-cod-portugal
Web icon

Zip Cod (Portugal)

Stable version 0.0.5 (Compatible with OutSystems 11)
Other versions available for 10
Uploaded
 on 29 January 2018
 by 
4.0
 (2 ratings)
zip-cod-portugal

Zip Cod (Portugal)

Documentation
0.0.5

Zip Cod Portugal User Guide

This user guide will help you install and use the Zip Cod Portugal component, an OutSystems component that allows you to validate and format Portuguese zip codes easily and quickly.

What is Zip Cod Portugal?

Zip Cod Portugal is an OutSystems component that allows you to validate and format Portuguese zip codes easily and quickly. With this component, you can integrate zip code validation into any OutSystems web or mobile application, ensuring data quality and compliance with national standards.

What are the requirements for Zip Cod Portugal?

To install and use Zip Cod Portugal, you need to have version 10 (Tradicional) or higher of OutSystems Platform. The component depends on the Regex extension, which must be installed and published in your environment. You also need to have permission to manage dependencies and consume REST APIs.

How to install Zip Cod Portugal?

To install Zip Cod Portugal, follow these steps:

  1. Access the Forge website (https://www.outsystems.com/forge) and search for the Zip Cod Portugal component.
  2. Click on the Download button and save the ZipCodPortugal.oml file on your computer.
  3. Open Service Studio and click on Open Application.
  4. Select the ZipCodPortugal.oml file and click on Open.
  5. Click on Manage Dependencies and check if all dependencies are satisfied. If not, click on Install From Forge to install the necessary extensions.
  6. Click on 1-Click Publish to publish the component in your OutSystems environment.

How to use Zip Cod Portugal?

To use Zip Cod Portugal in your OutSystems applications, you need to do two things:

  • Add a reference to the ZipCodPortugal module in your application. To do this, click on Manage Dependencies, select the ZipCodPortugal module in the list of producers and check the ZipCodPortugal_API checkbox.
  • Call the ValidateZipCode action whenever you want to validate a Portuguese zip code. This action receives as input parameter a string with the zip code and returns a boolean indicating whether the zip code is valid or not, and a string with the zip code formatted according to the NNNN-NNN standard. For example:
  • In your application, create a local variable called ZipCode of type Text.
  • Drag an Input widget to your screen and associate it with the ZipCode variable.
  • Drag a Button widget to your screen and set its On Click property as New Action.
  • In the logic of the button action, drag a reference to the ValidateZipCode action from the ZipCodPortugal module.
  • Pass as input parameter of the ValidateZipCode action the ZipCode variable.
  • Drag an If widget to check the value of the IsValid output parameter of the ValidateZipCode action.
  • If it is true, drag a Feedback Message widget to show a success message with the value of the FormattedZipCode output parameter of the ValidateZipCode action.
  • If it is false, drag a Feedback Message widget to show an error message with the text "Invalid zip code".

Frequently Asked Questions

Here are some common questions and answers about Zip Cod Portugal:

Q: What is the source of the zip code validation rules?
A: The zip code validation rules are based on the official specifications of the Portuguese postal service (CTT), which can be found here: https://www.ctt.pt/correio-e-encomendas/enviar-correio/opcoes-de-envio/codigo-postal.html
Q: How can I customize the format of the zip code?
A: The component uses the standard NNNN-NNN format for the zip code, which is the most common and recommended one. However, if you want to customize the format, you can use the Regex extension to apply your own regular expressions to the zip code string.
Q: Does the component work offline?
A: Yes, the component works offline, as it does not rely on any external service or API to validate and format the zip code. It only uses local logic and data.
Q: How can I report a bug or request a feature for the component?
A: You can use the Support tab on the Forge page of the component to report any issues or suggestions. You can also leave a review or a rating to share your feedback with other users.

Note: Due to the high number of records, the component was developed to load its records in the installation phase in a phased manner in packages, as loading them all at once could lead to overload of some servers with less capacity.