Posts

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

Call a simple Logic app from X++

Image
Logic apps can be called manually from D365FO with code I've made a basic Logic App that receive a short JSON. 1. Get JSON schema Get your JSON sample and go here and paste it in  https://www.liquid-technologies.com/online-json-to-schema-converter . Press Generate Schema and you have your schema in the box below. Example JSON : {   "sku": "875828",   "externalMaterialReference": "400267" } Example JSON Schema { "$schema" : "http://json-schema.org/draft-04/schema#" , "type" : "object" , "properties" : { "sku" : { "type" : "string" }, "externalMaterialReference" : { "type" : "string" } }, "required" : [ "sku" , "externalMaterialReference" ] } 2. Create Logic App In the Azure Portal or in your Visual Studio, cre...

Uninstall, delete a model

Image
It easy to create a model in D365 but not that easy to uninstall a model. It can be done however with the modelutil.exe file in K:\AosService\PackagesLocalDirectory\bin folder Syntax: modelutil.exe -delete -metadatastorepath="[Meta data file path]" -modelname="[Model name]" Example: modelutil.exe -delete -metadatastorepath="K:\AosService\PackagesLocalDirectory" -modelname="MyModel" You will be asked to confirm with y or n.

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

First post

First post Hi, I am a developer, worked with Dynamics development since 2008. In this blog I will post solutions to problems I've faced that I have not found in any other forum, or blog. Better go get the information out there than have all to my self.