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)

Hiding Data

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

I have a customized from, in that i have two types of data, 1. Semi finished 2. Finished.

Here i want hide finished records for few days and again i need to revert the as normal as now. How can i do this. Please guide me.

Thanks,

Krish

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi Krish Rao,

        You can add range for that finished records,  By using  queryBuildRange you can do this!

        Please have a look into this code, it may useful.

    public void runMyDynamicQuery2()
    {
        Query q;
        QueryRun qr;
        QueryBuildDataSource qbd;
        QueryBuildRange qbr;
    
        q = new Query();
        qbd = q.addDataSource(TableNum(CustTable));
    
        qbr = qbd.addRange(FieldNum(CustTable, AccountNum));
        qbr.value(">=4000"); // Default operator is ==.
    
        qbr = qbd.addRange(FieldNum(CustTable, AccountNum));
        qbr.value("<=4022");
    
        qbd.addSortField(FieldNum(CustTable, DlvMode));
    
        qr = new QueryRun(q);
        qr.prompt();
    
        pause;
    }

    Thanks

    Suresh

  • Community Member Profile Picture
    on at

    Hi Suresh potlakayala,

    Where should i write this code, please guide me.

    Thanks,

    Krish

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Krish Rao,

     The above code is not the exact your solution.

     Declare QueryBuildRange and write code in form init method level.

     Please look into below piece of code to get an Idea. Based on that you can change the code.

    public void init()
    {
        super();
    
        queryBuildRange = CustInvoiceJour_ds.query().dataSourceTable(tableNum(CustInvoiceJour)).addRange(fieldNum(CustInvoiceJour, InvoiceId));
    
    }
    


    Here you need to change your tables and field which you want to hide the data.

    Thanks

    Suresh

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    The code above is not ready to be implemented, it was just shown to you as proof-of-concept.

    You can easily find blogs with tutorials on how to add query ranges if you use your favorite search engine, by looking up keywords like "ax form querybuildrange".

  • Verified answer
    Community Member Profile Picture
    on at

    Hi Krish Rao,

       Here you need to add range in

    Form DataSource> YourTable> Methods>ExecuteQuery:

    public void executeQuery()
    {
        queryBuildRange.value("*Finised");
        super();

    }

    I think this will works.

    Dear Vilmos Kintera,

    I dint mention the above code is the solution, I'm just giving some example.

    Thanks

    Suresh

     

  • Community Member Profile Picture
    on at

    Hi Suresh potlakayala,

    Thanks for help, I'm able to hide the finished data, but in field filters showing "*Finished" and when i removed that, both data able see.

    Thanks,

    Krish

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Krish Rao,

        It is easy way to filter data, If any body want see the Semi finished data they can remove to filter.

    Thank

    Suresh

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    You can set a range's status as Locked, or Hidden, so filters cannot be altered.

    msdn.microsoft.com/.../querybuildrange.status.aspx

    Use the RangeStatus enumeration as value.

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