Источник:
https://www.dynamicsaxtraining.com/p...-by-attributes
==============
Contents:
- Released products form
- Category and sub-category search
- And/Or search
- Cross hierarchy/category search
- Customer form
- Sales order form
- Invoice lines
- Inventory On-hand form
- Add new sales line
- Setup
- Add new configuration
- Setup controls
Released products form
The
Released products form is one of the main forms to start form.
Note that there is the standard
Populate product attribute values periodic job that is used to populate the product attribute values. It is not required to be run on the test drive environment, but if you play in your own environment don’t forget to run it.
To filter products by hierarchy/category and attributes do the following:
- Lookup the Hierarchy, Category field
- Select the Contoso online hierarchy and Headphones category and click Ok
- Attributes that are assigned to the Headphones category appear automatically on the search pane. The grid is refreshed and contains released products from the Headphones category only.
- Select, for example, the following values in the attribute filters:
The grid is refreshed each time a new attribute filter value is selected.
Each attribute lookup shows needed attribute value automatically.
The Product attribute fact box is added to be able to review product attributes on the form.
With the help of the Product Attribute Search the ‘4306’ item with Bluetooth, Prosware brand and Mini USB connector has been found in the USRT company.
Click the
Copy button. The filtered items separated by comma will be copied to the clipboard. This can be used to copy the item list into other queries i.e. reports.
Category and sub-category search
Parent category often doesn’t contain attributes directly assigned to it, so attribute filters won’t be shown automatically on the search pane when filtering on the parent category.
You can add child category attributes to the search pane manually and filter on attributes from the child category:
- Lookup the Hierarchy, Category field and select Audio category
- The grid is refreshed and contains released products from the Audio category. The search pane doesn’t contain any attribute filter. Click the Add (+) button.
- The Product attributes form opens. The form contains all company attributes. Any attributes can be added to the Selected list. There is a Child attributes view option that filters out all child category attributes. Select one or many needed attributes from child categories and click Add. Let’s select Brand and Cord length attributes and click Ok.
- The search pane now contains the Brand and Cord length attribute filters.
Select, for example, the following values in the attribute filters:- Brand = Northwind Traders,
- Cord length = 4 and 5 (the multiselect lookup is supported).
With the help of the Product Attribute Search the ‘4302’ and ‘4303’ items with Northwind Traders brand and 4m or 5m cord length has been found in the USRT company.
And/Or search
Although the typical search need is an “And” search which works like a drill-down search the “Or” search is also supported. In the above example the “Or” option will give all products of the brans Northwind Traders or products where the cord length is either 4 or 5 irrespective of brand.
Cross hierarchy/category search
If it is required to find products from any hierarchy and any category the attribute filters can be added manually without hierarchy/category specified.
- Clear the Hiearchy, Category field. The attribute filters disappear from the search pane. The grid is refreshed and contains all released products.
- Click the Add (+) button to add a new attribute filter. The Product attributes form opens. Filter by Brand. Note that the USRT demo data contains two Brand attributes. Select the one that has the ProvisionedChannelAttributeText attribute type and click Ok.
- The Brand attribute filter is added to the Released product details form.
Select, for example, the following values in the
Brand attribute filter:
Fabrikam,
Litware (the multiselect lookup is supported).
The found released products separated by comma can be copied to the clipboard by
Copy button.
Customer form
Let’s review how the Product attribute search is implemented on other forms. For example, the Product Attribute Search can filter Customers by product attributes. All customers that have sales orders with items with specific attributes values will be filtered out.
- Open the All customers form and lookup the Hierarchy, Category field. Select the Contoso online hierarchy and Headphones category and click Ok
- Attributes that are assigned to the Headphones category appear automatically on the search pane. The grid with customers is not refreshed automatically.
Select Silicone in the Ear Cushions attribute filter.
Click the Search button to apply category and attribute filters.
- Click the Copy button. The customers separated by comma will be copied to the clipboard.
Sales order form
The related sales orders can be opened from the
All customers form. The Product Attribute Search automatically applies the Category and Product attribute filters to the
Sales order form in this case.
- On the All customers form select the 2002 customer, click Sell button tab > Related information > Orders > All sales orders
- All sales orders related to the selected customer that have items from the Headphones category and Silicone ear cushions will be shown.
Click the Copy button. Sales orders separated by comma will be copied to the clipboard.
Invoice lines
The related invoice lines can be opened on the
All customers form. The Product Attribute Search automatically applies the Category and Product attribute filters in this case.
- On the All customers form select the 2002 customer, click Sell button tab > Related information > Orders > Order lines
- All invoice lines related to the selected customer that have items from the Headphones category and Silicone ear cushions will be shown.
Click the
Copy button. Items separated by comma will be copied to the clipboard.
Inventory On-hand form
Inventory on-hand form is one of the most challenging one. Since it shows the aggregated (grouped) data per Inventory dimensions and Attributes.
- On the On-hand form populate the standard Site filter with CENTRAL value and click Apply. The grid will be populated with available on-hand.
- Lookup the Hierarchy, Category field. Select the Contoso online hierarchy and Headphones category and click Ok.
- Attributes that are assigned to the Headphones category appear automatically on the search pane. The grid is refreshed and contains on-hand for items from the Headphones category only.
- Select, for example, the following values in the attribute filters:
- Brand = Northwind Traders
The grid is refreshed each time a new attribute filter is selected.
Each attribute lookup shows needed attribute value automatically.
- All standard form behavior is supported.
For example, clear out the Hierarchy, Category field and click Dimension button. On the Dimensions display form selects Site, Warehouse, Location storage dimensions and click Ok.
- The On-hand form will be updated, as result on-hand will be split per Site, Warehouse, Location. Select the Headphones category in the Hierarchy, Category field and Yes in the Bluetooth filter. The on-hand is refreshed and contains on-hand for items from the Headphones category with Bluetooth.
Add new sales line
The Product Attribute Search is embedded in the
Add products form. When adding new lines a User can find products by category and attributes.
- Open the All sales orders form, select the any sales order. The Sales order details form opens. Click the Add products button.
- The Add products from opens. Select the Fashion navigation hierarchy in the Hierarchy field. Select the Handbags category. Attributes that are assigned to the Handbags category appear automatically on the search pane.
- Select, for example, the following values in the attribute filters:
- Bag type = Clutch,Closure type = Zip,
- Gender = Women.
The Available products grid is refreshed each time a new attribute filter is selected. Each attribute lookup shows needed attribute value automatically.
Then follow the standard flow to add a new line to the order.
The
Add products form is called from different forms. It means that filter products by attributes is available when new lines are created for:
- Sales order, Sales quotation, Purchase order, Purchase requisitions
- Modes of delivery, Trade agreement journals, Rebate agreements, Item requirements, Funds, Trade allowance agreements, Royalty agreements
- Counting, Transfer orders
- Retail and Commerce module: Buyer’s push, Mass update worksheet, Product packages, Print product labels, Product kit, Assortments, Commerce product hierarchy, View product recommendations, All discounts, etc
Setup
The Product Attribute Search implements the no code configuration approach. It means that attribute filters and/or attribute columns can be added to any form (standard or custom) via UI configuration without development.
From technical point of view there are no form’s extensions in the model. All filters are created during runtime. There is a generic engine that adds filters based on configurations.
The Parameters form is located under the path:
Product information management >
Setup >
Product attribute search >
Product attribute search parameters.
The Product attribute search pane can be added to any new or standard form. By default, the predefined configuration exists for 62 forms.
Add new configuration
For example, it is required to add the attribute search to the
InventTrans form (it is already added, but assume it is not).
To do this create a new record in the
Parameters form,
Search by attribute tab:
- Form name = InventTrans
- Control name = Filters
- Data source name = InventTransOrigin
- Field name = ItemId
The field can contains either ItemId or Product (RecId) value
- Enabled = Yes
Open the
Inventory transactions form and make sure the attribute search pane appears.
Add new configuration (Run time data source)
For example, it is required to add the attribute search to the
CustTable form. All customers with sales lines with products with specific attributes should be filtered.
To do this click the
Advanced button and create a new record in
Advanced attribute search setup form:
- Form name = CustTable
- Control name = CustomFilterGroup
- Data source name = TestDataSource (you can use any unique name for the data source).
The data source will be created during run time and linked to the root data source based on table relation automatically. Make sure a table relation exists:
- Table name = SalesLine
- Filed name = ItemId
Open the
Customers form and make sure the attribute search appears.
Add new configuration (Form extension)
It could be required to add much more data sources to the form to link item id(product id) with a main entity.
For example, it is required to add the attribute search to the
CustGroup form. All customers groups with customers with sales lines with products with specific attributes should be filtered.
In this case more than one data source is needed to filter out the
CustGroup form:
CustGrop -> CustTable -> SalesLine.ItemId.
If you have more than one data source, then you can create a form extension and specify all needed data sources and links between them.
- Create an extension for the CustGroup form and add two data sources:
- CustTable data source parameters:
- SalesLine data source parameters:
- Rebuild the model.
- Click the Advanced button on the Parameters form and specify the following:
- Control name = CustomFilterGroup
- Data source name = SalesLine
- First custom data source = CustTable. It is needed to disable the first custom data source in case no filters are selected to see also customers groups without customers assigned.
Open the
Customer groups form and make sure the attribute search appears.
Setup controls
All controls (filters, buttons) that appear on the Search pane can be configured via the
Advanced parameters form.
Search button
When the
Search button is enabled the search occurs only when the one is clicked. Otherwise, the search occurs each time the product attributes filters are modified.
Example of the
Search button on the
Customers form:
Copy button
The
Copy button is used to copy needed values separated by comma to the clipboard.
Note that fields from the data sources that are joined by Exist or Not Exists join cannot be copied.
Example of the
Copy button on the
Sales orders form:
Period filter
Period filter allows to filter any data by built-in or custom periods.
Example of the Period filter on the
Inventory transactions form:
Control order
The Control order allows to set up the place of each control on the search pane.
By the default the control order is populated automatically with the following value:
PIMPeriodFilterPIMEcoResCategoryIdPIMSearchPIMCopyPIMClearFiltersPIMSearchParameterPIMAttributeGroupPIMAddProductAttribute.
- PIMPeriodFilter – period filter
- PIMEcoResCategoryId– category filter
- PIMSearch – search button
- PIMCopy – copy button
- PIMClearFilters – clear filters
- PIMSearchParameter – search parameter (And/Or)
- PIMAttributeGroup – attribute filters
- PIMAddProductAttribute – add attributes button.
The control order is changed by moving the control names in the string. If the control name is removed from the string, the control won’t be shown on the Search pane.
For example, the
Released product details form has the following search pane:
Let’s move
Add attribute button between
Copy and
Clear:
- Open the Advanced parameters form and select the EcoResProductDetails form
- Set the following value to the Control order field: PIMPeriodFilterPIMEcoResCategoryIdPIMSearchPIMCopyPIMAddProductAttributePIMClearFiltersPIMSearchParameterPIMAttributeGroup
Open the
Released product details form and make sure the Search pane has the following view:
The post
Search by attributes first appeared on
Dynamics AX Training.
Источник:
https://www.dynamicsaxtraining.com/p...-by-attributes