Skip to main content
Solved

2024R2 Preview: Inquiry screen header filter returns no records


I’ve been learning how to create screens from scratch using the new UI framework, and so far I’ve created a simple maintenance screen and a basic Inquiry screen.
The maintenance screen is working just fine and the Inquiry screen is also working as expected except for one peculiar issue that I need help with that doesn’t even seem related to the new UI.

(I’m suspicious I may be overlooking something obvious, but the solution has eluded me!)

 

I am aware that the new UI is not ready for production use - I’m just trying to learn what I can so I’m ready for it!


The inquiry screen is built on a simple projection DAC and combines information from SOOrder, SOLine, and SOLineSplit.

The header of the screen has 2 filter fields.

Inquiry header filters


The “Only Show Completed Lines” filter is working correctly and when selected, only lines with an order status of “Completed” are shown.

The “Warehouse” filter returns 0 records when a filter value is entered. 

No Matching Records Found


I’ve shared screenshots of the relevant code below.
In debugging I have verified that the Filter.Current.SiteID property is not empty and contains a valid value, but somehow no results are being returned from the data view delegate.

Projection (detail) DAC:

Projection DAC

The Filter DAC:

Filter DAC

The Graph:

The Graph

Frontend Files:

Frontend Files

 

Any help is appreciated!

11 replies

Badge +12

I can't tell you why, but I think you could possibly bypass the issue by removing the null-check in AppendWhereAnd and write the Where<> like siteID.Equals<Filter.siteID.FromCurrent>.Or<Filter.siteID.FromCurrent.IsNull>

Userlevel 4
Badge

@darylbowman I’ll give your suggestion a try, but we do have several other screens that have it implemented as I did here, and it is working.

Badge +12

Did you set the SiteID field to CommitChanges = True?

Userlevel 4
Badge

@darylbowman 
Yes, that gets set in the typescript file. And the other filter field is also working.
 

 

Userlevel 4
Badge

I can't tell you why, but I think you could possibly bypass the issue by removing the null-check in AppendWhereAnd and write the Where<> like siteID.Equals<Filter.siteID.FromCurrent>.Or<Filter.siteID.FromCurrent.IsNull>

The “Filter” cannot be used as a type in a bql query, but I rewrote it as shown in the screenshot below, and now all records are returned regardless of the value in the filter. This is similar behavior to when filter conditions are specified in the main Data View query instead of through the use of a delegate method.
 

 

Badge +12

The “Filter” cannot be used as a type in a bql query

I can’t copy/paste the code out of your screenshots, and I was too lazy to spell out your type names 🙂 You did exactly what I was intending.

 

I’m curious if you’d remove the data view delegate and use this instead what would happen:


public SelectFrom<NUOrderDetailLine>.
Where<Brackets<NUOrderDetailLine.siteID.IsEqual<NUOrderDetailLineFilter.siteID.FromCurrent>.
Or<NUOrderDetailLineFilter.siteID.FromCurrent.IsNull>>.
And<NUOrderDetailLine.status.IsEqual<SOOrderStatus.completed>.
And<NUOrderDetailLineFilter.onlyShowCompletedLines.FromCurrent.IsEqual<True>>.
Or<NUOrderDetailLineFilter.onlyShowCompletedLines.FromCurrent.IsEqual<False>>>> Details;

 

Userlevel 4
Badge

I tried this, even though filter conditions in the main query haven’t worked previously.
Strangely, the bool filter works, but the SiteID filter does not. Entering a value does nothing to filter the data set. It seems to be completely ignored.

 

        public SelectFrom<NUOrderDetailLine>.
Where<
Brackets<
NUOrderDetailLine.siteID.IsEqual<NUOrderDetailLineFilter.siteID.FromCurrent>.
Or<NUOrderDetailLineFilter.siteID.FromCurrent.IsNull>
>.
And<
Brackets<
NUOrderDetailLine.status.IsEqual<SOOrderStatus.completed>.
And<NUOrderDetailLineFilter.onlyShowCompletedLines.FromCurrent.IsEqual<True>>
>.
Or<NUOrderDetailLineFilter.onlyShowCompletedLines.FromCurrent.IsEqual<False>>
>
>.OrderBy<Desc<NUOrderDetailLine.orderNbr>>.View Details;

 

Badge +12

I’m stumped 🤷🏻

Userlevel 4
Badge

I’m considering the possibility that it may be a bug in the 2024R2 preview build I’m running.
It’s simple functionality that I’ve implemented successfully multiple times on 23R2, so I’ll probably wait and see if something changes in the official release of 24R2.

Userlevel 4
Badge

Update: I found the issue.
When I created the unbound filter DAC, I set the IsDBField property of the Site Attribute to false.
It makes sense, since I’m using the Attribute on an unbound field. I’m pretty sure I remember seeing this used somewhere else, and I’m not sure why else I would’ve used this here. 

However, this was apparently incorrect. I reverted my code back to what I had in screenshots at the top of this post and removed this property from the attribute - now the SiteID filter is working as expected.
 

 

Userlevel 7
Badge

Thank you for sharing your solution with the community @MichaelShirk!

Reply