Tuesday, November 9, 2021

How to filter records in a form by code using extensions in d365 F&O x++


 In this case I'm filtering vendor invoice journals by creating an extension class in the form datasource -> init() method


I'm trying to filter vendor invoices with USD currency code


[ExtensionOf(formDataSourceStr(vendinvoicejournal, VendInvoiceJour))]

final class RKFormDS_VendInvoiceJournal_Extension

{

    public void init()

    {

        next init();

        

        str formName =  this.formRun().name();

        str callerName =  this.formRun().args().callerName();


        if(formName == 'VendInvoiceJournal' && callerName == 'RKVendInvoiceJournal')

        {

                          this.query().dataSourceName(this.name()).addRange(fieldnum(VendInvoiceJour, Currency)).value(SysQuery::valueLike("USD"));

            }

          

        }

    }


For more details please refer following link: http://dynamics-ax-live.blogspot.com/2010/03/how-to-filter-records-in-form-by-code.html

1 comment:

  1. You should take help from professionals who have immense experience on Dynamics 365 finance. They will help you with Solutions easily. Learn: Dynamics 365 F&O

    ReplyDelete

Why do users often get confused about Dynamics 365 Customer Engagement (D365 CE), Dataverse, and the Power Platform?

  The Microsoft ecosystem for business applications can sometimes be difficult to navigate, especially when discussing Dynamics 365 Customer...