static void Demo_GetProductAttributes(Args _args)
{
inventTable InventTable;
EcoResProductAttributeValue ecoResProductAttributeValue;
EcoResAttribute ecoResAttribute;
EcoResValue ecoResValue;
while select InventTable where InventTable.itemid == "1604"
join RecId from ecoResProductAttributeValue
where ecoResProductAttributeValue.Product == InventTable.Product
join Name from ecoResAttribute
where ecoResProductAttributeValue.Attribute == ecoResAttribute.RecId
join ecoResValue
where ecoResValue.RecId == ecoResProductAttributeValue.Value
{
info(strFmt("%1 - %2 - %3", InventTable.ItemId, ecoResAttribute.Name, ecoResValue.value()));
}
}
1. Create a View
Creating a view that combines the relevant tables is a good approach. This way, you can easily join InventTable
, EcoResProductAttributeValue
, EcoResAttribute
, and EcoResValue
to fetch the attributes you need. This will allow you to display them alongside item numbers in the grid and provide filtering capabilities.
Create a View in AOT:
InventTable
, EcoResProductAttributeValue
, etc.) and set up the joins as per your requirement.Define the Fields:
Implement Filtering:
Once you have your view created, you can modify the forms where you want to display these attributes:
Add the View as a Data Source:
Design the Layout:
Filtering Logic:
AllowEdit
, AllowFiltering
).Using a view is typically the best practice for this requirement, as it centralizes the logic for retrieving product attributes and allows for easy filtering. Make sure to test the performance of the view, especially if you're working with a large dataset, and implement any necessary indexing for optimal performance.
ItemId = "1604"
exists OR it might be due to missing relationships in the data.Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,782 Super User 2024 Season 2
Martin Dráb 229,067 Most Valuable Professional
nmaenpaa 101,150