This feels like something that should be straightforward, but I'm struggling with it. I'm using ClearCollect to create a Collection from a CDS entity. However, I just want the active records as I've no need to be storing the inactive ones.
Filter(Sites,Text(statecode)="Active") works but gives me the delegation warning. I can't help feeling that must be a neater way to just query the 0 or 1 value of the status rather than getting the text value of the statecode. If there's a better way, then this might help me avoid the delegation warning too.
I don't think that you can avoid the delegation warning because Status (or statecode) is a compound field. Intellesense did not expose any properties of the Status field like ".Value". However, in Model Driven Apps, it is easy to filter Active from InActive records using metadata alone. That being said,
I was playing around with it and I found that if you add a column to your collection