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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 18.02.2009, 21:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Ruslan Goncharov: A few words about sorting codes
Источник: http://rusgon.blogspot.com/2009/02/f...ing-codes.html
==============


In AX each item may be assigned by its own sort code. On the other hand each WMS location has its own sort code and there is a functionality for updating sort codes.
Let's analyse how do they work together.Take a look at WMSAisle table which has following fields:
  • inventLocationId
  • sortCode
  • sortDescending
  • aisleId
  • aisleNo
A sample of WMSAisle table:


By the way combination inventLocationId and aisleId fields is unique (see \Data Dictionary\Tables\WMSAisle\Indexes\AisleIdx).
Every time when we try to update WMSLocation sort codes (e.g. \Menus\Invent\Periodic\Locations\Sort codes)updateSortCodes() method of WMSAisle table is invoking. The sort codes are updating in two steps:
- initialSortCode seeking;
- updating sort codes;
Determining of initialSortCode
If WMSParameters.manualSortCode is true the initialSortCode is assigned by WMSAisle.sortCode. Else initialSortCode will be equal maximal value of WMSLocation.sortCode for all aisles less than current aisleNo.To understand how does it work suppose there is an inventLocation 00001 with several aisles (WMSAisle table)

inventLocationId aisleId aisleNo 00001 1 1 00001 2 2 00001 3 3 00001 4 4 00001 5 5 00001 6 6 00001 7 7 00001 8 8 00001 9 9

WMSLocation is filtered by inventLocationId = '00001'

inventLocationId LocationId sortCode aisleId 00001 1-07-2-1 11 1 00001 1-07-2-2 12 1 00001 1-07-2-3 13 1……… 00001 1-07-2-20 30 1 00001 1-07-2-21 31 2 00001 1-07-2-22 32 2……… 00001 1-07-2-32 42 2 00001 1-07-2-33 43 3 00001 1-07-2-34 44 3……… 00001 1-07-2-39 49 3……… 00001 1-07-2-91 101 9 00001 1-07-2-92 102 9……… 00001 1-07-2-92 112 9

We are trying to determine initialSortCode for aisleId = 3.Aisles less 3 are 1 and 2. For these aisles (1 and 2) maximal sortCode is 42. Therefore in our example initialSortCode is 42.

Updating sort codes

Updating sort codes is pretty easy and works according following algorithm:

sortCode = initialSortCode;WMSLocation.sortCode = sortCode;sortCode++;
i.e. each record updating aisle WMSLocation.sortCode is incrimenting by 1.
If WMSAisle.sortDescending is true all the records before updating are arranged by descended rack, ascended level and ascended position.
If WMSAisle.sortDescending is false records are arranged by ascended rack, ascended level and ascended position.
It is useful to mention that records with WMSLocation.manualSortCode = true are excluded from initialSortCodeseeking and sort codes updating.And now take a look at WMSOrderTrans table (reservation). At Tables\WMSPickingRoute\Methods\makePickingLineWMSPickingRoute.makePickingLine method we may watch on followng lines:

select firstonly forupdate WMSOrderTransCopy index hint RouteIdx where WMSOrderTransCopy.routeId == WMSOrderTrans.routeId && WMSOrderTransCopy.fullPallet == NoYes::No && WMSOrderTransCopy.recId == WMSOrderTrans.recId; WMSOrderTransCopy.routeId = this.pickingRouteID; WMSOrderTransCopy.sortCode = (WMSLocation) ? WMSLocation.sortCode :WMSOrderTrans.WMSLocation().sortCode; WMSOrderTransCopy.itemSortCode = inventTable.sortCode; WMSOrderTransCopy.volume = WMSOrderTrans.qty * inventTable.grossVolume(); WMSOrderTransCopy.expectedExpeditionTime = expectedPickTime; WMSOrderTransCopy.fullPallet = NoYes::No;
Here WMSLocation.sortCode and inventTable.sortCode are stored. And the result of sorting codes we may watch in WMSPickForm form where records are arranged by itemSortCode and sortCode.

queryBuildDataSource.addSortField(fieldNum(WMSOrderTrans, routeId)); queryBuildDataSource.addSortField(fieldNum(WMSOrderTrans, itemSortCode)); queryBuildDataSource.addSortField(fieldNum(WMSOrderTrans, sortCode)); queryBuildDataSource.addSortField(fieldNum(WMSOrderTrans, itemId)); queryBuildDataSource.addSortField(fieldNum(WMSOrderTrans, dataAreaId));
\Forms\WMSPickForm\Data Sources\WMSOrderTrans\Methods\init()
Therefore itemSortCode is more prevalent than Location sortCode as described in Logistic documentation.Copyright © 2009 Ruslan Goncharov

Источник: http://rusgon.blogspot.com/2009/02/f...ing-codes.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Ruslan Goncharov: Storing report design in database Blog bot DAX Blogs 0 27.08.2008 18:05
Ruslan Goncharov: Scrolling in AX 3.0 without dll Blog bot DAX Blogs 0 09.03.2008 23:20
Ruslan Goncharov: Quick sorting in info messages Blog bot DAX Blogs 0 09.02.2008 19:11
Ruslan Goncharov: How to get the screenshots of all open windows in AX Blog bot DAX Blogs 0 12.01.2008 12:31
Ruslan Goncharov: Lorenz attractor Blog bot DAX Blogs 0 09.01.2008 22:50
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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