Hi @QHFJESP,
Your projection config looks right. The association is not what filters the list though, it only makes the relationship available to the client. The filtering happens on the page, and that part is missing.
Right now your list is most likely pointed directly at CAuditCheckListSet as its data source, so it loads every row in the table. You need to bind the list to the Audit record on the page instead.
In Page Designer on the Audit page:
- Turn off the preview first. If you leave it on you get a runtime error when you create the Binding object.
- In the Active Page structure, find the element that holds the current Audit record (the selector/singleton the header fields sit on) and note its name. That is your Bindname.
- Select the reference to your Check List list in the page content.
- Expand the optional attributes and create the Binding object.
- Set Bindname to that Audit selector element, and set Property to AudAuditID (your association name).
- Do not also set a fixed Data Source on that list reference pointing at the entity set. The binding supplies the data.
- Save and publish, turn the preview back on, then reload the page with a hard refresh.
Two things to check if it still shows everything after that:
- What type is the Audit ID column on CAuditCheckList? If it was created as a Reference field, it can store the object key rather than the plain value, and the key mapping will never match. A plain number or text field that your custom event fills with the Audit ID works reliably.
- Confirm the value your custom event writes is identical in format to AudAudit.AUDIT_ID, no padding or type difference.
Once the binding works you can hide the Audit Id column in the list, it becomes redundant.
If you can post a screenshot of the list reference in Page Designer showing the Binding and Data Source properties, easy to confirm from there.
Thanks,
Gleb