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)

Filter Data on different Form having same DataSource in AX 2012

(0) ShareShare
ReportReport
Posted on by 4,624

Hello,

 I have one Standard Form and second form is copy of this standard form( let say "Customized Form") . Both forms are having same DataSource. So records created on standard form would be display also on my customized form. But I want to show records only on my customized form that will be create by my customized form and same approach for standard form.

i hope it would clear to you , please tell if any query.

Please suggest what can i do the best approach for this?

Thanks.

Visvash Walia

*This post is locked for comments

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    what is purpose of standard form if you don't want to show records on that? Just hide the complete form from user interface if that is so useless.

  • Verified answer
    DavidGunawan Profile Picture
    1,381 on at

    Hi Visvash

    You can add a new field in the table of the data source. This field act as a flag of creation source. Then in standard form and customized form you can modify the create() method in datasource to initiate the value of the flag field. The final part is you need to modify the data source executeQuery() method to filter based on the flag.

    Regards

  • Rohin Profile Picture
    4,624 on at

    I think you don't understand my concept Sohaib , i apologize for that.

    Standard form is used for another purpose and my customized form is used for another purpose. like i said both forms have same datasource so records would display to both forms . But i want to show records on my customized form only those are created on same form and similar for standard form , records should be display only those are created by standard form.

    hope this clears and please suggest

    Thanks.

    Visvash Walia

  • Rohin Profile Picture
    4,624 on at

    Thanks David for understanding  and suggestion,

    I got you point . Please correct me if i am wrong :

    1. I will create one boolean field

    2. on Create method of datasource (Customized Form DataSource) , i need to initiate the value of this boolean field.... right?

    3. then use execute query() method of form dats source and do filter.

    thanks.

    Visvash walia

  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    logically thinking keep a flag(field) inside table/datasource, which should keep information about from where record has been created.

    Finally you can filter records on both forms using that flag field.

  • DavidGunawan Profile Picture
    1,381 on at

    Yes, you are correct.

  • Rohin Profile Picture
    4,624 on at

    Hello ,

    the create method of my data Source is :

    void create(boolean append = false)

    {

       custInvoiceTable_ds.object(fieldNum(CustInvoiceTable, OneTimeCustomer)).skip(false);

       custInvoiceTable_ds.object(fieldNum(CustInvoiceTable, OneTimeCustomer)).allowEdit(true);

       super(append);

       cvHeader_OrderAccount.setFocus();

       element.allowEditCustBillingClassification();

    }

    where can i add my code to initiate my field(boolean) .. need to add after super or before super call ? and what should be the best practice to initiate field . can you please tell me the way to write code.. is it same like update the field value ?? like :

    myTable.myBooleanField = Noyes::Yes;

    Thanks

    Visvash Walia

  • Wojciech Ociepa Profile Picture
    35 on at

    Actually you don't have to create extra form that looks the same as the original. You can link the query that filters data (and anything you need) with display menuitem that opens the form. You can also use different enum parameter values (in menuitem) and pass them to the form.

  • Rohin Profile Picture
    4,624 on at

    yes , you right but i have to make one customized form that utilize standard form functionality but something different in behavior  as per my requirement so i can't do that.

    Thanks

    Visvash walia

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