I have a requirement where i am importing some attribute data through integration into maximo.However the client demands the field value needs to hidden or encrypted with special characters and only the last few numbers to be shown similar to a bank account number. How do i achieve this? An example suppose the field value is 1234567 client wants this to be shown as ****567
-
Is hiding all of the contents of the field acceptable? Maximo only gives you two options out of the box: hide none of the characters or hide all of the characters. Doing something else goes beyond standard Maximo coding. You would then be looking at some kind of custom control that copies the standard text box control but adds partial hiding. Custom controls are _very rarely_ created. – Dex Dec 22 '19 at 03:45
-
No that is the challenge not all contents of the field needs to be hidden. We have to omit the last five digits of the account num and the rest needs to be hidden – BuddingMaximoDeveloper Dec 23 '19 at 02:51
-
There is a difference between "not all of the characters _need_ to be hidden" and "the last few characters _can't_ be hidden". It sounds like the latter, in which case JPTremblay's answer is a good work around. – Dex Dec 23 '19 at 03:21
2 Answers
Here's a simple solution that should do it: define a persistent attribute (accountnum) to save your account number and a non persistent one to display its partially masked version (maskaccountnum).
Create an attribute launch point automation script to initialize the non persistent value.
Python Example:
if not mbo.isNull("accountnum") :
mbo.setValue("maskaccountnum", "****" + mbo.getString("accountnum")[-3:])
Add your non persistent attribute to your application.

- 900
- 5
- 8
I created a non persistent attribute as stated by JPTremblay. and upon getting confirmation with client for a fixed range of numbers for the attribute ACCOUNTNUMBER there was no need for a dynamic script.
so i just created a object launch point script. event is chosen as Initialize
and just one line of code
mbo.setValue("maskaccountnum", "************" + mbo.getString("accountnum")[-5:])
this did the trick. Language was chosen as Jython.
-
Yes, it's a good solution to use the init event. However, make sure that you have a value in your `accountnum` attribute before setting the mask attribute or you could get an error. – JPTremblay Jan 06 '20 at 14:57