- the position of @ is not the first character
- .(dot) is not the last character.
- @ is not repeated else where in the string
- Dot is not repeated else where in the string
Monday, 14 November 2016
Validating Email Address in Peoplecode
We have a number of pages in PeopleSoft, where user/admin is free to enter email addresses. How to validate if a value entered in a PeopleSoft field is a valid email address?
In general, how does an email id look like? It will have few characters followed by @ symbol followed by few characters and then a .(dot) symbol followed by few more characters. So, we have to validate the presence of these.
For example, if &email_addr is a variable which contains the string entered in email address field and needs to be validated then try the below code:
&AT = Find("@", &email_addr);
&DOT = Find(".", &email_addr);
If ALL(%AT,&DOT) Then
/* Validation Success */
/* Validation Fail*/
/* Issue Error message */
Additionally we could also perform checks to ensure that:
This can be done by using instr, substr and len functions.
HAPPY LEARNING :)
COSTED_FLAG = Y or N If you are adding a row PS_TRANSACTION_INV, you have to decide if you want the row to be taken into account by the c...
Creating a Custom Run Control Page This step is the same regardless of whether you will ultimately use the Run Control page with an SQR ...
Dave Duffield and Ken Morris founded PeopleSoft in 1987, when they engineered the company’s first human resources application. Built on a ...
Description: Use the SQLExec function to execute a SQL command from within a PeopleCode program by passing a SQL command string. The SQL...