Posts

Showing posts from May, 2020

List all product in assortment for a store

Image
A customer wanted a functionality that needed the listing of all products in a stores assortment. The assortment for a store can be viewed in the online stores form. To list these is quite cumbersome and involves quite a few tables. I got this query by debugging the init method of the called query. Rewrote it from standard MS SQL syntax to X++ select statement. The statement lists the same products as viewed in the View assortment  products button. private void onlineStoreProductListByOperatingUnitId( RefRecId _omOperatingUnit ) {         EcoResProduct ecoResProduct;     EcoResProductMaster ecoResProductMaster;     EcoResProductDimensionGroupProduct ecoResProductDimensionGroupProduct;     EcoResProductDimensionGroup ecoResProductDimensionGroup;     EcoResProductTranslation ecoResProductTranslation;     InventTable inventTable;     RetailChannelAssortedProductView retailChannelAssortedProductView;     while select RecID, DisplayProductNumber