web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to add range in AOT for empty string or null

(0) ShareShare
ReportReport
Posted on by 709

Hello guys,

A newbie, if I have a View in my AOT that I want to add Range that only include field that it is empty. What I need to type in Range ?

The field itself is a string datatype.

Currently I put something like this but it seems not working:

pastedimage1606725596425v1.png

It's a Data entity view, btw

Thanks.

I have the same question (1)
  • WillWU Profile Picture
    22,361 on at

    Hi ShaqAX,

    You could try to add range in the onInitializedEntityDataSource event.

    FormDatasource fb = _sender.dataSource();
    QueryBuildDataSource qbd= fb.query().dataSourceTable(tableNum(SalesTable));
    qbd.addRange(fieldNum(SalesTable, Stringfield)).value(queryValue(""));

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi ShaqAX,

    You can use an advanced filter function and place value (SysQueryRangeUtil::valueEmptyString()) into value property.

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    It should work for empty strings (null values are a different case).

    If I was you, I would look at T-SQL code defining the view (through SQL Server Management Studio) and debugged this code directly. When I knew how I wanted to change T-SQL, I would go back to AX and change the view definition.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans