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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.07.2024, 18:20   #1  
Blog bot is offline
Blog bot
Участник
 
25,554 / 848 (80) +++++++
Регистрация: 28.10.2006
erconsult: D365 Mass de-reservation utility
Источник: https://erconsult.eu/blog/d365-mass-...ation-utility/
==============

Prehistoric art at the Niedersachsenhaus lodge, Austria

D365 Mass de-reservation utility







In the Production control module in Dynamics 365 for SCM there is an automatic BOM reservation feature. For example,  set the reservation on Estimation in the module parameters, run the materials Estimation for all open orders, done. If you did it by mistake, it is you who are done, because in the case of a just-in-time supply and a long production order backlog, the reservation if going to quickly deplete the stock, preventing any future urgent order from starting.

Since the reservation can only be cancelled production order by production order, BOM line by BOM line, then in a medium sized plant in can take a few days of repetitive work. In Dynamics 365 Business Central aka “Navision” the state of affairs is similar.

Below is a programmatic solution, a runnable class for mass de-reservation. You may add a menu item in a D365 menu, or just run the following command in the browser:  https://xxxprod.operations.dynamics....nventDeReserve

The user may select the type of the order to cancel the reservation for, and add additional criteria such as the warehouse, expected date of the order et cetera. Set the safeguard parameter Cancel reservation to Yes, then run with OK. Upon successful execution, the system will show a number of success messages such as “Reference: Production line, Number: B000021 Item number: 205026, Lot ID: 002516 Reservation has been removed“.

You may copy or download the X++ source code below: InventDeReserve



class InventDeReserve extends RunBaseBatch implements BatchRetryable{ QueryRun queryRun; boolean dereserveNow = false; DialogField dlgDereserveNow; #define.CurrentVersion(1) #localmacro.CurrentList dereserveNow #endmacro protected void deReserveByQuery() { while (queryRun.next()) { InventTrans inventTrans = queryRun.get(tableNum(InventTrans)); if (inventTrans.StatusIssue != StatusIssue::ReservPhysical && inventTrans.StatusIssue != StatusIssue::ReservOrdered) { continue; } InventDim inventDim = queryRun.get(tableNum(InventDim)); InventDimParm inventDimParm; inventDimParm.initFromInventDim(inventDim); ttsbegin; InventUpd_Reservation::newParameters(InventMovement::construct(inventTrans), // At these specific inventory dimensions only inventDim, inventDimParm, InventDimFixedClass::inventDimParm2InventDimFixed(inventDimParm), -inventTrans.Qty, false, // Do not allow auto reserve dim true /*Show info*/).updateNow(); ttscommit; } } public void run() { #OCCRetryCount if (! dereserveNow) { info("@SYS52714"); // Nothing to do return; } try { this.deReserveByQuery(); } catch (Exception::Deadlock) { retry; } catch (Exception::UpdateConflict) { if (appl.ttsLevel() == 0) { if (xSession::currentRetryCount() >= #RetryNum) { throw Exception::UpdateConflictNotRecovered; } else { retry; } } else { throw Exception::UpdateConflict; } } } public container pack() { return [#CurrentVersion, #CurrentList, queryRun.pack()]; } public boolean unpack(container _packedClass) { Version version = RunBase::getVersion(_packedClass); container packedQueryRun; switch (version) { case #CurrentVersion: [version, #CurrentList, packedQueryRun] = _packedClass; queryRun = new QueryRun(packedQueryRun); break; default: return false; } return true; } public Object dialog() { DialogRunbase dialog = super(); dlgDereserveNow = dialog.addFieldValue(extendedTypeStr(NoYesId), dereserveNow, "@SYS50399" /* Cancel reservation */); return dialog; } public boolean getFromDialog() { dereserveNow = dlgDereserveNow.value(); return super(); } static void main(Args _args) { InventDeReserve inventDeReserve = new InventDeReserve(); if (inventDeReserve.prompt()) { inventDeReserve.runOperation(); } } public void initParmDefault() { super(); this.initQuery(); } void initQuery() { queryRun = new QueryRun(new Query(queryStr(InventDeReserve))); } QueryRun queryRun() { return queryRun; } public boolean showQueryValues() { return true; } static ClassDescription description() { return "@SYS50399"; // Cancel reservation } public final boolean isRetryable() { return true; } public boolean canGoBatchJournal() { return true; } public boolean canRunInNewSession() { return true; }}


Production and Manufacturing blog series



Further reading:

Picking list journal: Inventory dimension Location must be specified
Consumable “Kanban” parts in D365 Warehouse management
Production order should not get Released on material shortage
Subcontracting with Warehouse management Part 2
Subcontracting with Warehouse management Part 1
Semi-finished goods in an advanced warehouse
The case of a missing flushing principle








The post D365 Mass de-reservation utility appeared first on ER-Consult.



Источник: https://erconsult.eu/blog/d365-mass-...ation-utility/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Sumit Potbhare: Retail Warehousing | Wrap up | Approach to D365 for Commerce with Adv WH Mgmt Blog bot DAX Blogs 0 28.04.2021 13:12
patrickmouwen: How to Unlock Many Hidden D365 Retail Features! Blog bot DAX Blogs 0 13.05.2020 22:13
patrickmouwen: D365 Retail APIs Part II: How to know exactly what happens inside D365 Retail Blog bot DAX Blogs 0 14.12.2019 01:17
jaestevan: Dynamics 365, AppSource, PowerApps y compañía… ¿Qué esperar del futuro de los ERP en Microsoft? Blog bot DAX Blogs 0 26.07.2016 22:11
jaestevan: PowerShell para la administración automática de Dynamics AX 2012 (PS-II) Blog bot DAX Blogs 0 28.06.2016 17:11

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

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

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