The PeopleCode below will only display the last 4 digits of a social security number. I have placed the code in a Component PostBuild event and it works perfect.
DERIVED_HR.SOCIAL_SECURITY_NUMBER = Replace(DERIVED_HR.SOCIAL_SECURITY_NUMBER, 1, 7, “XXX-XX-”);
Here, I’m using the replace PeopleCode built-in function. The functions takes the value from a the above field, starts at position 1 and replaces the 1st 7 characters with the string “xxx-xx-”.
The result:
After this code gets executed, SSN on a page should show up as xxx-xx-5623
No comments:
Post a Comment