Skip to main content
Dynamics 365 general forum
Suggested answer

Filter not empty inventSiteId from InventDim

editSubscribe (0) ShareShare
ReportReport
Posted on by 35

Hi there,

I am trying to filter not empty values for InventSiteId from InventDim table but it is still showing empty in my view for InventSiteId 

First, I created a query with below code and added datasource as InventDim.

public void init()
{
super();

QueryBuildDataSource qbdsInventDim = this.query().dataSourceName(tableStr(InventDim));

QueryBuildRange inventSiteIdRange = qbdsInventDim.addRange(fieldNum(InventDim, InventSiteId));
inventSiteIdRange.value(SysQuery::valueNotEmptyString());
inventSiteIdRange.status(RangeStatus::Hidden);
}

I used above query in my view and added fields.

I did build and sync db but I still see empty values in my View for InventSiteId.

I did try creating view based on InventDim and added range for inventSiteId and value as (SysQuery::valueNotEmptyString()) but it is still showing empty values in my View for InventSiteId.

Not sure what is wrong here. It must work with above code. Any suggestion?

  • GirishS Profile Picture
    GirishS 27,799 Super User on at
    RE: Filter not empty inventSiteId from InventDim

    Have you tried adding the range in the query itself as mentioned earlier?

    I

    Thanks,

    Girish S.

  • Richard Gill Profile Picture
    Richard Gill 35 on at
    RE: Filter not empty inventSiteId from InventDim

    Hi both,

    Its not standard form. Its a new query and view created for testing purpose.

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,534 Super User on at
    RE: Filter not empty inventSiteId from InventDim

    Hi, Your query looks ok, If its standard form then please check if the range is getting reset. For instance, check executeQuery method of form dataSource.

    For D365 F&O queries, you can use below Forum for more suggestions.

    community.dynamics.com/.../dynamics-365-for-finance-and-operations-forum

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,799 Super User on at
    RE: Filter not empty inventSiteId from InventDim

    Hi Richard gill,

    Have you consider adding a range in the view itself instead of code?

    Try adding range to field InventSiteId and keep value as empty string "" and check.

    Thanks,

    Girish S.

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,045 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,570 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans