File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Server-Side Components/Business Rules/Base64-Encode-Before-Save-And-Display Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 11//This is Before Insert/Update Business Rule to automatically store sensitive data in Base64 form.
22
33( function executeRule ( current , previous ) {
4- if ( current . u_field1 . changes ( ) ) {
5- var plainText = current . u_field1 + '' ;
6- current . u_field1 = GlideStringUtil . base64Encode ( plainText ) ;
4+ if ( current . variblename . changes ( ) ) {
5+ var plainText = current . variblename + '' ;
6+ current . variblename = GlideStringUtil . base64Encode ( plainText ) ;
77 }
88} ) ( current , previous ) ;
99
1414//this is Display busiess rule to make sure users see the decoded text instead of Base64
1515
1616( function executeRule ( current ) {
17- if ( current . u_field1 ) {
17+ if ( current . variblename ) {
1818 try {
19- var decoded = GlideStringUtil . base64Decode ( current . u_field1 ) ;
20- current . setDisplayValue ( 'u_field1 ' , decoded ) ;
19+ var decoded = GlideStringUtil . base64Decode ( current . variblename ) ;
20+ current . setDisplayValue ( 'variblename ' , decoded ) ;
2121 } catch ( ex ) {
22- current . setDisplayValue ( 'u_field1 ' , '[Invalid Base64]' ) ;
22+ current . setDisplayValue ( 'variblename ' , '[Invalid Base64]' ) ;
2323 }
2424 }
2525} ) ( current ) ;
You can’t perform that action at this time.
0 commit comments