ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Function expose] Codeunit 7307 Whse.-Activity-Register Code

Open BertDeTemmerman opened this issue 8 years ago • 5 comments

In Codeunit 7307 Whse.-Activity-Register the functions LocationGet and GetItemUnitOfMeasure2 (why 2? where's the original?) would have to be global and external and return via VAR the getted Location/ItemUnitOfMeasure (so you can get rid of the global variables).

LOCAL LocationGet(LocationCode : Code[10])
IF LocationCode = '' THEN
  CLEAR(Location)
ELSE
  IF Location.Code <> LocationCode THEN
    Location.GET(LocationCode);

LOCAL GetItemUnitOfMeasure2(ItemNo : Code[20];UOMCode : Code[10])
IF (ItemUnitOfMeasure."Item No." <> ItemNo) OR
   (ItemUnitOfMeasure.Code <> UOMCode)
THEN
  IF NOT ItemUnitOfMeasure.GET(ItemNo,UOMCode) THEN
    ItemUnitOfMeasure.INIT;

The function UpdateWhseShptLine should be global + external and the variable WhseShptLine should be a local (instead of a global). TY

BertDeTemmerman avatar Jul 18 '18 09:07 BertDeTemmerman

This one somehow fell through the cracks! Sorry about that! I will create the appropiate work item and we'll get back to you with our findings.

JesperSchulz avatar Oct 19 '18 12:10 JesperSchulz

Can happen :) TY

BertDeTemmerman avatar Oct 19 '18 12:10 BertDeTemmerman

Hi, The functions LocationGet and GetItemUnitOfMeasure have been made external previously in August and you should be able to view it in the preview. There was no specific reason for why the GetItemUnitOfMeasure had 2 at the end of the method and that has since been removed.

What is the reason you require UpdateWhseShptLine to be external?

darjoo avatar Oct 31 '18 11:10 darjoo

Ah thank you :)

What is the reason you require UpdateWhseShptLine to be external?

(Had to check again) When exploding a BOM-item on saleslines, we don't change the the BOM-item to a textline. When the components get picked, we need to know if everything is picked for the BOM-item. We changed the Code function in COD7307 to handle this.

Now in order to have the same functionality with events, we have to duplicate the functions LocationGet, GetItemUnitOfMeasure2 and UpdateWhseShptLine in our subscriber codeunit (with no changed logic). When these functions becomes global and external, we can just call them from our subscriber. Thanks

BertDeTemmerman avatar Nov 07 '18 07:11 BertDeTemmerman

Thanks for the reply. We've gone ahead with your request to make UpdateWhseShptLine external. We usually include these types of changes in the next minor release, so look for it there.

darjoo avatar Nov 07 '18 14:11 darjoo