Ever heard of the followling......
To simplify the Warehouse process, I've made some customizations in which I've placed several standard functions after oneother...
From a Sales Order, with one push on the button you can create a Warehouse Shipment, release it, and place the Warehouse Shipment Lines in the Pick Worksheet. Simple as that....
But....
In this process various tables are locked, and released. Unfortunately, one lock still remains: The creation of the Whse. Shipment results in a message ("Whse. Shipment xxx has been created.").
As long as this message is on the screen, the Table Whse. Item Tracking Line remains Locked!!!!!!!!
How is this possible?!?!?!
We've even tried it with a COMMIT before this message, but the lock remains....
0
Comments
Marco
Microsoft Certified Trainer
Cronus.it
Well, I've set a HideDialog function to TRUE, so the message won't appear anymore. This solves the locking problem, but still..... How is it possible that this message creates this problem?!
btw, how are things in Rotjeknor these days? I used to live there...
RIS Plus, LLC
Also, when the steps are called one by one, there will also appear messages, which DON'T lock the tables. So in these situations the Transactions are already closed BEFORE the messages are clicked away, I think.
I still say: A message should NEVER lock a table!!
Main codeunit: Sub codeunit:
When you execute the main codeunit you migth expect it to do exactly the same. But it doesn't! It does like this:
Yes: Beep, Message, Beep, Message
No: Beep, Beep, Message, Message
I guess this means you can solve your problem by stop using the default OnRun trigger, but instead move the code to a function and call that directly instead.
Peter
Case 2 and 3 result in
BEEP,BEEP,Message,Message
While Case 1 results in
BEEP,Message,BEEP,Message
In my eyes defenitely NOT a feature, but a BUG!!!!!
PS: Pdj, thanks for your input!
When you have an error, it stops code execution at the line of code with the error. Both of these mean that the current transaction is not completed yet, and all table locks will still be in effect. This is the way that it is implemented in Navision. You can disagree with it all you want, but it's not going to change it Maybe someone at Microsoft reads these posts and agrees with you and it will be changed in the next release.
RIS Plus, LLC
Peter
I just extended your code a bit to get all ways:
Case 2 and 3 and 5 result in
BEEP,BEEP,Message,Message
While Case 1 and 4 results in
BEEP,Message,BEEP,Message
I agree that 1 and 4 should be considered a bug.
Peter
By the way, I agree that it is strange that the system does it differently in all those different cases. To me it feels like some of it can be explained by the strange way Navision handles messages, but I would not know how exactly :oops:
RIS Plus, LLC
The original code was: which means message first, and then after that a beep. So if I run this code twice in a row, I expect MESSAGE, BEEP, MESSAGE, BEEP
I would say that all reported cases are false. Am I losing my mind???? :shock:
RIS Plus, LLC
cases 2,3,5: messages are buffered till the end. so that's way beep,beep,msg,msg
cases 1,4: first msg is buffered, then beep is heard, but just when it comes to second call of CU, the first msg is forced to be displayed, before the second call of CU is going to be executed. then the second msg is buffered and beep is heard. at the end bufferd msg (2nd) is displayed. ->beep,msg,beep,msg
obviously it has to do with CU when defined as variable and called with CU.RUN.
looks like the call of CU.RUN when CU defined as var forces msg buffer to clear before call...
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
I know that a "BEEP(100,100);" is pretty useless, but I use it instead of a db transaction. BEEPs are never buffered and are very suitable to simulate a transaction. You could try replacing the beep statement with If you then run the code you will notice that the cust table is locked until the message box is closed. (Try opening a second client on the same db and modify a cust) This was actually the original problem reported by Caffa.
I don't think so, but I can't give any promises 8)
Peter
By the way:
The problem DOESN'T occur in 2.60!!!!