Customizing AX released Product listpage Filter using x + +

Source: Internet
Author: User
Tags microsoft dynamics

In Microsoft Dynamics ax, listpages is more restricted from customization than in prior versions of AX.  Primary reason for the restriction are so, the list pages maintain compatibility with Enterprise Portal.  Recently a customer had a requirement where the filter needs to is available on the list page and is on the client side. I spent quite some time searching for a solution and thought I ' d share my workaround here–this post would outline how T o Create a customized filter on the released Product list page.

The requirement: Quickly find released product by External Item number and display the released product number (s) The Released Products List page.

The solution: Since We is looking for data not part of any DataSource on the original query–and due to some Jo In complexities, customizing the existing query is also not a option, X + + became the last option.  (as know, external item data is stored in the Custvendexternalitem Table.) Microsoft specifies for developers to change the *lpinteraction class, however I has to date not found any concrete examp  Les for using the class to manipulate the list pages. For this example we'll modify the released Product List Page by overriding the modified method on a filter field.

Here's how:

1. We need to allow overriding of methods in the form (which by default are not allowed on Forms of formtemplate:  Listpage).  Navigate to the aot–> forms–> ecoresproductpercompanylistpage–> designs–> design–> group:filter–> properties–> Display Target and select "Client".  Note This means the filters would only be visible in the AX client and not via EP.  This would also allow us to actually override the ' modified ' method on the filter form. Ensure the filter is Visible, Displaytarget are set to Client and the Caption, Frameoptionbutton and OptionValue can B E Set as needed/desired.

2. Create a new field under the Filter section, ensure this autodeclaration is set to "Yes" and that the proper data type  is selected. In this case the Extendeddatatype should is "Externalitemid"

3. Override the "modified" method on the Field. Note If you is unable to the override any method then you have not completed step number 1 above.

3. Paste code below to filter by the external customer/vend ItemId. Note:there was many different ways to create the desired result other than below, notably the "QueryFilter" object is Ano Ther alternative.

12345678910111213141516171819202122232425262728293031323334353637383940 </pre>public boolean modified(){boolean ret;QueryBuildRange qbr;QueryRun queryRun;Query query;QueryBuildDataSource qbds;SysTableLookup lookup;ItemId itemId;CustVendExternalItem custVendExternalItem;ret = super();if (this.valueStr()){query = new query();qbds = query.addDataSource(tableNum(CustVendExternalItem));qbr = qbds.addRange(fieldNum(CustVendExternalItem, ExternalItemId));qbr.value(queryValue(this.valueStr()));queryRun = new QueryRun(query);while (queryRun.next()){custVendExternalItem = queryRun.get(tableNum(custVendExternalItem));itemId = custVendExternalItem.ItemId;break;}// if we found a match in the external item table show itif (itemId){InventTable_ds.queryBuildDataSource().addRange(fieldNum(InventTable, ItemId)).value(itemId);InventTable_ds.executeQuery();}}else{InventTable_ds.queryBuildDataSource().clearRanges();InventTable_ds.executeQuery();} return ret;}

4. One nice thing about the filter Group was that it includes a display type, I had selected "Hide" which allows a user T  o Hide it if they don't want to see/use the specific filter with minimal screen real-estate being consumed. Run an X + + compile the form and Incremental CIL compile and the released Product form should look like below.

5. For our example I has added a external item Id "S1ctestitem" in the Contoso environment.  Let's see how product this item corresponds to. Just type in the External Item Id and hit Tab or enter.

The form runs the query and displays the result.

6. Just to confirm, we go to the ' External Item Description ' form and as you can see everything checks out.

That ' s it! As you can see that the basic framework for customizing the list page form if you cannot change the Query object or is Not able to pass the necessary parameters to the Lpinteraction class.

Customizing AX released Product listpage Filter using x + +

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.