Hello I have an expensive MAXROW expression that queries a database to identify the most recent record (see below). I’m looking to restrict the expression as much as possible while ensuring it functions as needed and thought to only run the expression when the 2 views are active. I’ve added this to the expression and the system does display the expression as needed for the 2nd view “drop_route_header_activity” but not the 1st. I’ve tested just using the “drop_site_header_detail_mn” view, listed them separately and used IN() as well but it never picks up that “drop_site_header_detail_mn” view. I’ve also checked the spelling, copy/pasted it but still no luck.
If this is not a good method for restricting the expression, how else could I restrict the expression when restricting other fields in the row isn’t an option?
A million thank you’s!
IF(
AND(
[_THISROW].[record_status]=“Pending”,
OR(
CONTEXT(view)=“drop_site_header_detail_mn”,
CONTEXT(view)=“drop_route_header_activity”
)
)
MAXROW(
“drop_checklist_activity”,
“date_entered”,
AND(
[cms_sites_id]=[_THISROW].[cms_sites_id],
[checklist_item_id]=[_THISROW].[checklist_item_id],
[record_status]=“Pending”
)
)
,
“NA”
)
