O/P - 1
O/P - 2
O/P - 3
When I directly query the comments table with a filter to fetch comments where the audit is null, it returns the expected results(O/P - 1). However, when I apply the same filter in a related record query from the main test table, it does not return any comments(O/P - 2). Interestingly, if I remove the audit filter, the related record query returns the correct data(O/P - 3). Any idea what could be causing this issue?
Discussion posts and replies are publicly visible
Not sure what you try to do...
To fetch a single record item and its related records, you just add that relationship to the fields list.
The relationship between Comment and Audit is one-to-one, established through the field commentId. I need comments with null audit. Its working when we directly query comment(O/P - 1) but its not not working if I apply same filter in related record(O/P - 2).
If you define a 1-1 relationship, then you cannot query items not having a valid relationship.