Question


Foray Software Pvt Ltd
IN
Last activity: 9 Feb 2018 3:05 EST
Format for Account Number
hi everyone
I need to display account number in below format: xxx-xxx xxxx xxxx (123-456 7890 1234)
propety type= formatted text( source = Datatransform) there is no input here.
pls help
Thanks
***Edited by Moderator Marissa to update categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!


Pegasystems Inc.
US
Hi Venkat,
Could you share the screenshots of your data transform, how the property value is coming? What do you mean by "there is no input here" in the data transform.
Regards
Mahesh
Updated: 8 Feb 2018 10:13 EST


Pegasystems Inc.
US
I tried a sample use case with data transform and the function to convert the "12345678901234" to "123-456 7890 1234" format as shown in the attachment.


Foray Software Pvt Ltd
IN
Hi Mahesh,
Here is the exact requirement
I am getting Account number(Read only) based on the CustomerID, if the customerID changes Account number also changes right.
I need to change my a/c num format which is existing one 12345678901234 to mock up of 123-456 7890 1234
In this code'String Input" we are giving any value because which is a readonly accountnumber value getting from based on customerId.
if(theValue != null && theValue.trim().length() == 14)
{
String Input = theValue;
theValue = Input.substring(0,3)+ "-" + Input.substring(3,6) + " " + Input.substring(6,10) + " " + Input.substring(10,14);
}
kindly pls modify the code and help me pls.
Thanks


Pegasystems Inc.
US
The above code seems to be correct. Can you please let us know what is failing here.


Foray Software Pvt Ltd
IN
hi all
we have String Input = theValue;
here what is the String Input? i understand we have to give some value to the property at run time right that is the issue here.
1.we are not giving input value manually at run time
2.Input type taken as formatted text so that we cant enter any value to it
3.Input value (Account Number) which is getting based on customer ID.
pls help me


Pegasystems Inc.
US
If you look into my use case which is shared in this post, i am using the function to format it. For testing purpose i had sent the static string "12345678901234", but in your usecase you can pass the property which holds this value as input, for example,
@(Jenkins:SampleLibrary).AccountNumberFun(.PropertyName)
Hope this is clear to you, if not let us know.


Pegasystems Inc.
US
String Input here means there is there is variable name "Input" which is of datatype "String". You can pass this "theValue" to some java method and in that java method, format it as per your requirement. Hope this clarifies.