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 :
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,284 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,284 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

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans