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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 29.05.2021, 05:27   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
erconsult: WHS Label copies, Custom work, display methods on labels
Источник: https://erconsult.eu/blog/whs-label-...splay-methods/
==============

Todays exercise is seemingly simple: print a voluntary number of warehouse label copies where the standard Dynamics 365 SCM only prints one. The ingredients are quite exquisite and variegated:

^PQ

Let’s start with a proof of concept: print as many labels as there are items. Assuming there are 3 items on the license plate (pallet), let’s print the same label 3 times. This sounds simple, yet you need the latest and the coolest feature Enhanced license plate label layouts. With that feature you can finally carve a substring from Dynamics data, but also format numbers and dates. This is exactly what we need.

In Warehouse management > Setup > Document routing > Document routing layouts, every Zebra label template ends with something like
^PQ1,0,1,Y
which is the instruction to the label printer how many copies to print. Now replace this line with
^PQ$Qty:0$,0,1,Y
The quantity as a real number is truncated to an integer on the label, and the ZPL printer makes as many copies as there were pieces on the pallet.

Display method

A real game changer is now the ability to parse a display method on the WMSLicensePlateLabel table. Let Dynamics calculate the number of copies on the fly, leveraging the PackingQty factor which is the number of pieces in the topmost unit of the Unit sequence group. Assuming the unit sequence group is PCS-BOX i.e. pieces in boxes and if the nominal quantity per box is 20, for a license plate with 100 items on it I would like to have 5 copies of the label.

Extend the WMSLicensePlateLabel as follows
[ExtensionOf(tableStr(WHSLicensePlateLabel))]
final class WHSLicensePlateLabel_Extension
{
display Num noOfCopiesSimple()
{
return int2Str(this.PackingQty > 1 ? any2Int(roundUp(this.Qty / this.PackingQty,1)) : 1);
}
}
and embed it into the ZPL code like this:
^PQ$noOfCopiesSimple()$,0,1,Y

Now the number of copies is dynamic, configurable and obeys the master data settings.

Custom work

The high end solution is to let the user override and decide how many copies to print. In order to do that, before the Print line in the Work template we need an extra screen of the Custom work type:


This brings the following prompt on the mobile device

You may also want to explore possibilities of simple validations and post-processing of the data captured on the Custom work screen:
Custom method tutorial.

The number of copies entered by the user is then interpreted by a more sophisticated display method:
display Num noOfCopies()
{
int noOfCopies;
WHSWorkLineCustom workLineCustom;
WHSWorkLine workLine;
select firstonly Data from workLineCustom
exists join workLine
where workLine.WorkId == this.WorkId
&& workLine.WorkType == WHSWorkType::Custom;
if (workLineCustom.Data)
{
noOfCopies = str2Int(workLineCustom.Data);
}
if (! noOfCopies)
{
noOfCopies = this.PackingQty > 1 ? any2Int(roundUp(this.Qty / this.PackingQty,1)) : 1;
}
return int2Str(noOfCopies);
}

Enjoy!

The post WHS Label copies, Custom work, display methods on labels appeared first on ER-Consult.



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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
mfp: Extending WHS – Adding a new custom work type Blog bot DAX Blogs 6 13.04.2017 10:57
Kashperuk Ivan: Tutorial: Caching display methods Blog bot DAX Blogs 3 29.09.2015 22:07
Kashperuk Ivan: Tutorial: Custom work types and shipment notes on the mobile device in Warehouse management module in Dynamics AX 2012 R3 Blog bot DAX Blogs 0 01.07.2015 19:11
DynamicsAxSCM: WHS Work List Blog bot DAX Blogs 0 19.06.2015 15:11
emeadaxsupport: How label flushing works under the hood Blog bot DAX Blogs 0 17.08.2010 16:05
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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