Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

Filter not empty inventSiteId from InventDim

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,828 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,540 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,828 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

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,584 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,864 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans