Item Journal Batch Names

naffnaff Posts: 31Member
Hi,

I am experiencing trouble with some of our production orders.
And I believe it is because somehow users sharing the same records in their production journal.

We have several users "DESK1", "DESK2", "DESK3" and so on and they are simultaneously entering data into their production journal for the same production order (even the same operation!). I believe the problem is that NAV sets the batch name automatically to the User-ID of the current user. But in addition it also cuts of any trailing numbers.
I don't understand why this is necessary. Isn't it dangerous because now the same batch name is used for multiple users.
I assumed that it was to prevent something about automatic increase of numbers in batch name but then again it justs deletes the trailing numbers and not the numbers inside the name.

This is the code I am talking about.
Codeunit 5510 Production Journal Mgt, Function: SetTemplateAndBatchName()

...
ToBatchName := '';
User := UPPERCASE(USERID); // Uppercase in case of Windows Login
IF User <> '' THEN
IF (STRLEN(User) < MAXSTRLEN(ItemJnlLine."Journal Batch Name")) AND (ItemJnlLine."Journal Batch Name" <> '') THEN
ToBatchName := COPYSTR(ItemJnlLine."Journal Batch Name",1,MAXSTRLEN(ItemJnlLine."Journal Batch Name") - 1) + 'A'
ELSE
ToBatchName := DELCHR(COPYSTR(User,1,MAXSTRLEN(ItemJnlLine."Journal Batch Name")),'>','0123456789');
...


How can I make sure that users don't interfere with another when working on the same production order on the same operation?
We are using NAV 2015.

Best Regards.

Answers

  • bostjan.les@gmail.com[email protected] Posts: 30Member
    Change usersid's and there is no need for code change.
  • naffnaff Posts: 31Member
    Change usersid's and there is no need for code change.

    I have no intention to change the code.
    I just assumed that NAV somehow should be able to handle user names with numbers at the end.
    After all this is nothing exceptional. Renaming those users will not be easy since they are also used for many other things outside NAV.
Sign In or Register to comment.