Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
BertDeTemmerman opened this issue Jul 18, 2018 · 5 comments
Closed

Comments

@BertDeTemmerman
Copy link

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

@JesperSchulz
Copy link
Contributor

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.

@BertDeTemmerman
Copy link
Author

Can happen :)
TY

@darjoo
Copy link
Contributor

darjoo commented Oct 31, 2018

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?

@StanislawStempin StanislawStempin transferred this issue from microsoft/AL Nov 1, 2018
@BertDeTemmerman
Copy link
Author

BertDeTemmerman commented Nov 7, 2018

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

@darjoo
Copy link
Contributor

darjoo commented Nov 7, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants