[SysODataActionAttribute("GetDiscountsOfChannel", false), SysODataCollectionAttribute("return", Types::Record, "KRTRetailPeriodicDiscountEntity")] public static List GetDiscountsOfChannel(RetailChannelId _retailChannelId, date _startBeforeDate) { KRTRetailPeriodicDiscountEntity discount; KRTRetailDiscountChannelEntity discountChannel; List discounts = new List(Types::Record); while select discount where discount.ValidFrom <= _startBeforeDate && ( discount.ValidTo == dateNull() || discount.ValidTo >= today()) exists join discountChannel where discountChannel.OfferId == discount.OfferId && discountChannel.RetailChannelId == _retailChannelId { discounts.addEnd(discount); } return discounts; }
POST https://<base url>/data/<entity resource name>/Microsoft.Dynamics.DataEntities.<action name> HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 Content-Type: application/json;odata.metadata=minimal Accept: application/json;odata.metadata=minimal Accept-Charset: UTF-8 Authorization: Bearer <access token> Host: <base url> { <JSON formatted method parameters> }
POST https://proddev0313cbbc0662fada44devaos.cloudax.dynamics.com/data/KRTRetailPeriodicDiscounts/ Microsoft.Dynamics.DataEntities.GetDiscountsOfChannel HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 Content-Type: application/json;odata.metadata=minimal Accept: application/json;odata.metadata=minimal Accept-Charset: UTF-8 Authorization: Bearer <access token> Host: proddev0313cbbc0662fada44devaos.cloudax.dynamics.com { "_retailChannelId" : "000032", "_startBeforeDate" : "2017-06-26" }
[SysODataActionAttribute("GetOverlappingDiscounts", true), SysODataCollectionAttribute("return", Types::String)] public List GetOverlappingDiscounts() { KRTRetailPeriodicDiscountEntity discount; List discounts = new List(Types::String); var discountOverlapCalculator = new RetailDiscountOverlapCalculator(); discountOverlapCalculator.parmRetailPeriodicDiscount( RetailPeriodicDiscount::findByOfferId(this.OfferId)); RetailDiscountAnalysisTmp overlappingDiscounts = discountOverlapCalculator.CalculateOverlapsForDiscount(); while select discount exists join overlappingDiscounts where overlappingDiscounts.OfferId == discount.OfferId { discounts.addEnd(discount.OfferId); } return discounts; }
GET https://<base URL>/data//<entity resource name>(<keyField1> = <value1>,<keyfield2> = <value2> …) HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 Accept: application/json;odata.metadata=minimal Accept-Charset: UTF-8 Authorization: Bearer <access token> Host: <base URL>
GET https://proddev0313cbbc0662fada44devaos.cloudax.dynamics.com/data/KRTRetailPeriodicDiscounts( OfferId='ST100002',dataAreaId='USRT') HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 Accept: application/json;odata.metadata=minimal Accept-Charset: UTF-8 Authorization: Bearer <access token> Host: proddev0313cbbc0662fada44devaos.cloudax.dynamics.com
POST https://<base URL>/data//<entity resource name>(<keyField1> = <value1>,<keyfield2> = <value2> …)/Microsoft.Dynamics.DataEntities.<action name> HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 Content-Type: application/json;odata.metadata=minimal Accept: application/json;odata.metadata=minimal Accept-Charset: UTF-8 Authorization: Bearer <access token> Host: <base URL> { <JSON formatted method parameters> }
POST https://proddev0313cbbc0662fada44devaos.cloudax.dynamics.com/data/ KRTRetailPeriodicDiscounts(OfferId='ST100002',dataAreaId='USRT')/ Microsoft.Dynamics.DataEntities.GetOverlappingDiscounts HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 Content-Type: application/json;odata.metadata=minimal Accept: application/json;odata.metadata=minimal Accept-Charset: UTF-8 Authorization: Bearer <access token> Host: proddev0313cbbc0662fada44devaos.cloudax.dynamics.com { }
DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.
Authors are allowed to set their own AdSense units.
Join us.