Question
Sberbank
RU
Last activity: 12 Sep 2017 5:55 EDT
Localize Property Names in Validate Rule
I have a class with 3 properties and section with Grid where instances of this class are showing. All properties are required so I have created a Validate rule to do this which is called when pxCreateRecordInner is working. When I click "Add record" in the grid and left properties blank Validate rule works and following message is shown:
.<PropertyName> <Message from Validate Rule>
My question is how to localize ".<PropertyName>" ?
I had created pyLabel\pyFieldLabel\pyMessageLabel for property but it isnt work.
Pega Version is 7.2.2
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
Hi,
You need to create a field value for property name and give the localized value in this field value, then the localized value will be picked instead of the default property label.
Please let me know if this helps.
Regards,
Vikash
Sberbank
RU
Hi, Vikash
As you can read in the first post, I've already tried it. It did not help.
Pegasystems Inc.
IN
Please try the steps mentioned in the attached document and let me know if it helps.
Sberbank
RU
VikashKarn,
Thanks for your reply! I tried your solution and got results that you can see in the attached files. Properties message1 and message2 still contain <PropertyName:>.
And main question is how can I apply the approach using activity with Property-Set-Message step and etc.. if I have property with type PageList and RepeatGrid? I thought that in this case I can only use pyDefault datatransform for initialize Page in PageList property.
Pegasystems Inc.
IN
Please do the follwoing:
1)add category as "pyMessageLabel" in the Property-Set-Method of the activity
2) Create field value of TestMessage with Field name as "pyMessageLabel"
Now run the activity, you will see the localized values instead of text.
Thanks,Sriniavs
Sberbank
RU
ok, I will try this but how can I apply the approach using activity with Property-Set-Message step and etc.. if I have property with type PageList and RepeatGrid? I thought that in this case I can only use pyDefault datatransform for initialize Page in PageList property.
Sberbank
RU
Hi, thanks for your response. I have did all as you said but it stil didn't work. Please, take a moment and see config in attach file.
Pegasystems Inc.
IN
Hi,
Please do small correction in your activity as below.
1) Add one step with loop above step1 with step page as .ListOfRoles. Now this is your step-1
2) Add a child step same as your original step 1 . This is Step 1.1
3) Mention your individual property in field name of step 1.1, to which you would like to show the message.
Finally, comment your original step.
Your message rules seems to be fine. let me know, if you still have trouble in achieving your use case.
Thanks,Sriniavs
Sberbank
RU
Hi, Sriniavs
Thanks for your help. That helped. But I was faced with another problem localization. When I leave an empty field, which is the key in the class, then ValidateKeysContent activity works, which adds the message to the page as follows:
String strLocalizedKeyValue = tools.getParamValue("strKeyValue");
String strLocalizedKeyLabel = tools.getParamValue("strKeyLabel");
String strLocalizedKeyName = tools.getParamValue("strKeyName");
if(strLocalizedKeyValue.equals(""))
{
// add the error message
tools.getPrimaryPage().addMessage("KeyRequired\t"+strLocalizedKeyLabel, strLocalizedKeyName);
}
And I can't localize strLocalizedKeyName var. Can you help me with this ?