Posts

Showing posts with the label Syntax

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;   ...

Sales order Holds

Image
Sales orders in D365 can have holds, stopping their further processing. He is the data diagram over the tables. A select statement would look like this, showing all sales orders that have a certain hold code.         SalesTable salesTable;         MCRHoldCodeTrans holdCodeTrans;         MCRHoldCodeTable holdCodeTable;            while select  SalesId,                  from salesTable                                  join MCRHoldCode, InventRefId                     from holdCodeTrans          ...

Retail Attributes on sales lines

Image
Recently I've dived into Retail. There will be some posts about retail and the problems I've faced with solutions. First off will be the Retail Attributes, they can be problematic here is a data base diagram illustrating a simplyfied view, assuming the value is of type text. And here is the select statement for listing all sales lines with their attributes.         SalesTable salesTable;         SalesLine salesLine;         RetailSalesTableInstanceValue instanceValue;         EcoResAttribute attribute;         EcoResAttributeValue attributeValue;         EcoResTextValue      textValue;     while select salesId                  from  salesLine  ...