How to use boolean value from other entity in activitydesktopview entity?

93 views Asked by At

I am working on adding a new column in activitydesktopview that shows the value from claim entity. For example, I want to display claim.Indicator.Ison and check if the activity has any document attached. I tried using Activity.Documents.hasElements or Documents.isEmpty but they did not work.

I get an error message saying the specified path is not valid. How can I add these values directly in activitydesktopview entity?

I know I can use enhancement property but that is not a proper way to do it.

2

There are 2 answers

2
Abhijay Kumar On

ActivityDesktopView is a view entity and the dot notation Activity.Documents is trying to traverse an array. If you are using the viewEntityColumn sub-element then it does not allow traversing arrays and hence the error. This is mentioned in the View Entities Documentation (Requires Login).

The path attribute definition cannot traverse arrays.

The path attribute is always relative to the primary entity on which you base the view.

I figured that the computedcolumn sub-element doesn't allow traversing arrays either and the other way to deduce this would be using something like the below on the boolean cell of the list view or through an enhancement property like you mentioned.

ActivityDesktopView.Activity.Documents.Count > 0

0
Enrique Alonso On

Something else you could explore is to denormalize the value of the property you are looking for in preupdate rules (ActivityPreupdate in this case), and after that you could add a viewEntityColumn in your viewEntity for the denormalized column, accessible directly as a field from Activity (something like Activity.ActivityDocumentCountDenorm_Ext or Activity.ActivityHasDocumentsDenorm_Ext). I would recommend against this solution if the primary entity for the view entity was Claim (for performance reasons, since it probably has more frequent changes and more Preupdate rules to evaluate) but for Activity it might be a suitable solution.