AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 27.07.2019, 00:16   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
stoneridgesoftware: How to Create a Transportation Management System Rate Engine in Dynamics 365 Finance and Operations
Источник: https://stoneridgesoftware.com/how-t...nd-operations/
==============

The other day I had to create a new Transportation Management System (TMS) Rate Engine in Dynamics 365 Finance and Operations so that the weight could be included in the calculation of a rate. The math desired was to add a multiplier on the standard rate calculation where the weight of the shipment would be divided by a divisor (set as a parameter on the rate engine) and then multiplied by the rate.

For example: Rate per mile: $1, Mileage: 100, Weight: 100, Divisor on new rate engine: 25. The math would work out to be (100/25) * 1 * 100 = $400.

While that is a simplistic example, the point remains that the desire was to utilize the weight.

While following the link for Create a new transportation management engine was helpful as to the actual creation of the class, what I found was that to utilize the mileage point we needed to do various changes. The first thing is we want is for our class to extend the MileageRateEngine class, this is what will allow for the calculated rate to be added to the form. Without that we were able to see the calculated rate when debugging, but that rate would not transfer to the form.

As far as the code to actually do the math using the rate engine, you’d extend the rate method and execute the following code in addition to the standard mileage engine code:

decimal num = BaseRateEngine.RetrieveRate(tMSRateBase, tMSRateBaseDetail, (tMSFwkMileageHelperResponse.parmMiles() * tMSRateBaseDetail.Rate) / StringExtensions.ToDecimal(tMSRateBaseDetail.Dimension1)); //get shipment/load weight decimal wght = XDocExtensions.SumDown(shipment, ElementXmlConstants.Weight); // multiply ton-miles rate by wght of the load num = num* wght; // XElement re = shipment.RetrieveOrCreateRatingEntity(this.RatingDto); xElement.AddRate(TmsRateType.Rate, num);Happy calculating! If you have any questions about TMS in Dynamics 365 for Finance and Operations, let us know if we can help!



Источник: https://stoneridgesoftware.com/how-t...nd-operations/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
stoneridgesoftware: How ‘One Version’ Affects Dynamics 365 Finance and Operations Users Blog bot DAX Blogs 0 10.05.2019 19:16
stoneridgesoftware: How to Resolve Code Merge Conflicts after Upgrading to Dynamics 365 for Finance and Operations Blog bot DAX Blogs 0 12.07.2018 11:11
powerobjects: How to Integrate Power BI with Dynamics 365 for Finance and Operations Blog bot Dynamics CRM: Blogs 0 26.06.2018 01:23
stoneridgesoftware: How to Multi-thread Your Imports in Dynamics 365 for Finance & Operations Blog bot DAX Blogs 0 03.05.2018 12:11
stoneridgesoftware: Webinar: When & How to Upgrade from Dynamics AX to Dynamics 365 for Finance & Operations Blog bot DAX Blogs 0 06.04.2018 06:15
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 23:24.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.