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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Container and unbounded string fields are not allowed in a WHERE expression.

(0) ShareShare
ReportReport
Posted on by

I had a requirement to store huge data of xml into AX table i.e. I used string size as [MEMO].

Response1, Response2 & Response3 are Memo Fields.

Now my requirement is to perform to select some data based on where conditions checking Response 1, Response 2 & Response 3 parameters in where clause but it gives me Error

Note: I wanted to check for NULL & NOT NULL

Container and unbounded string fields are not allowed in a WHERE expression.

  while select * from appLog

where appLog.ReceiptNo == ""  

&& appLog.Response1 != ""

&& appLog.Response2 != ""

&& appLog.Response3 == ""

        {                resultSet.addEnd(appLog.Response2);

         }

Note: After finding error details I came to know you can not use MEMO fields in where clause and have to use IF condition .

Therefore the query was changed as below.

  while select * from appLog

            where appLog.ReceiptNo == ""

        {

            response1 = appLog.Response1;

            response2 = appLog.Response2;

            response3 = appLog.Response3;

         

            if(response1 != "" && response2 != "" && response3 == "")

            {

                resultSet.addEnd(appLog.Response2);

            }

        }

Now query is working but I wanted to achieve the above using where clause.

I know this is not the best i.e. would like to know what could be done to fine tune the query.

*This post is locked for comments

I have the same question (0)
  • Mea_ Profile Picture
    60,286 on at

    Hi Ashraf Ansari,

    You may try full text index and full text search, it works with memo fields but you will have to rewrite it to a query, please refer for additional details www.1clickfactory.com/.../microsoft-dynamics-ax-2012-how-to-filter-a-memo-field-in-full-text-index

  • Community Member Profile Picture
    on at

    It will require to modify table by adding columns. I don't want to do at this stage.

    I thought we can design query similar to SQL where we can easily check whether column is null or not

    thanks for your reply.

  • Community Member Profile Picture
    on at

    Hi, I am not searching any data rather doing Null or Not Null checks in where clause.

    Your solution is good where one is required to do full text search.

  • Mea_ Profile Picture
    60,286 on at

    In this case you can use direct SQL msdax.wordpress.com/.../executing-sql-directly-from-x there are lots of cons why you should not do this, but you can consider this as an option.

  • Community Member Profile Picture
    on at

    Yes this option is there but I don't wanna use it. As I said earlier I just wanted to retrieve data based on null & not null. X++ should have built in support for that irrespective of filed type.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans