Add message to property not working in pagelist on submit of flow action

Configuring add messages to property on post action of flow is not highlighting messages on property level, instead its just highlighting on page level up top.

Any idea or is this a missed use-case in constellation 24.2 pega box.

Hi @SohamChanda1107

If you want to set the validation error message on the field as well, then you have to use the function @pxAddMessageToProperty(“MessageRuleName“, “FieldName“) if you are using a post data transform (In activity, it is Property-Set-Messages method)

If its a page message on top the assignment which is a generic error, then you have to use @pxAddMessage() or @pxAddMessageToPage() functions (In activity, it is Page-Set-Messages)

Below is snapshot of using pxAddMessageToProperty function in a post DT which shows error on both field and also on top the assignment. This is in v24.2.1

Hope this helps

Regards

JC

We tried the same approach only, but that only is not working in a pagelist. We are looping inside the dt we are calling this function. And only it comes up on main page.

@SohamChanda1107

Nested validation rules make great sense here. Create a validation rule (in dev studio) on the object that the list points to. Mark it relevant. Switch back to app studio. Then at case level, add a validation to your flow step, select your pagelist, and choose “call validation”. Reference here the validation you created at object level. This will validate each item in the list and add the message only where it fails the validation.

The nice thing with this approach is that you can do it almost entirely from app studio. Only the specific validation rule on the data object needs to be created in dev studio (from what I know). The rest can be done via “configure user action > conditions” (or “configure view” before Pega ‘25) on the flow step in the case type in App Studio.

Some references below:

3 Likes

Also this approach mentioned by @LantzAndreas works with Inline Table Editing and Modal as well in the same way. Also with v25, you will additionally have Field warnings as well to show warning messages on the fields based on conditions while on change of the values. However these are just for display and will not stop you from proceeding further

Regards

JC

Yes that we have already used for simpler validations the nested validations.

This is one of more complex validations which needs to be done via post processing dt only thats why looking if it works on a property level message.

Write an activity and invoke your validate rule using the Obj-Validate method.

Call this activity from your post DT using @pxExecuteAnActivity() function (OR)

Call this activity from flow action post processing

Regards

JC

Yes even in post action if we have complex logic I tried calling validate rule from DT, which in-turn is nested and it works

1 Like

Also, recently we have got a similar requirement where we have inline table editing and on change of the field content we should show a message specifically for that field. Of course we should stop the submission of the form as well if that validation fails.

So we have put the validation in a when rule and setup the show field input warning for that field which will then trigger the warning message on the UI for that column.

If user still does the submit action, then on the validate rule / post DT we can apply the same when rule to validate the list and setup the messages accordingly. Then it will show the message as an error.

This will give a clear indication to the user upfront to avoid additional clicks. Client actually liked the warning and error icon and color differentiation for the messages.

Hope this approach helps anyone who is looking for a similar requirement.

Regards

JC