Lockings with Messages!?!?!?!?!

Caffa
Member Posts: 15
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....
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
-
Just to be sure, have you tried to delete or comment the message? It seems strange to be the message the problem....
Marco0 -
Yep...
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?!0 -
Because the message is part of the transaction, and the system won't close the transaction until the user clicks the message away. As you said 'simple as that'
btw, how are things in Rotjeknor these days? I used to live there...0 -
Well, we've even tried a COMMIT before the message......
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!!0 -
I think the reason is due to a special (un-documented?) feature of OnRun in codeunits. Try making two codeunits:
Main codeunit:OnRun() IF CONFIRM('Use OnRun?') THEN BEGIN Sub.RUN; Sub.RUN; END ELSE BEGIN Sub.Something; Sub.Something; END;
Sub codeunit:OnRun() Something; Something() MESSAGE('hi'); BEEP(100,100); SLEEP(1000);
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.Regards
Peter0 -
mm.. strange. What do you think about the following....
Selection := STRMENU(Text000); CASE Selection OF 1: BEGIN SubFloop.RUN; SubFloop.RUN; END; 2: BEGIN CODEUNIT.RUN(CODEUNIT::SubFloop); CODEUNIT.RUN(CODEUNIT::SubFloop); END; 3: BEGIN SubFloop.FunctieFloop; SubFloop.FunctieFloop; END; END; (Where Text000 = Use "Variabel.RUN", Use "Codeunit.RUN (Codeunit::...)", Use "Variabel.Function")
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!0 -
Caffa wrote:Well, we've even tried a COMMIT before the message......
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!!
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 itMaybe someone at Microsoft reads these posts and agrees with you and it will be changed in the next release.
0 -
DenSter> It seems you are missing the point. We are not talking about ERROR but the simple MESSAGE. Have you ever seen it documented that it can stop a transaction?Regards
Peter0 -
Caffa>
I just extended your code a bit to get all ways:Selection := STRMENU( 'Use "Variabel.RUN",'+ 'Use "Codeunit.RUN (Codeunit::...)",'+ 'Use "Variabel.Function",'+ 'Use IF "Variabel.RUN" THEN,'+ 'Use IF CODEUNIT.RUN(CODEUNIT::SubFloop) THEN'); CASE Selection OF 1: BEGIN SubFloop.RUN; SubFloop.RUN; END; 2: BEGIN CODEUNIT.RUN(CODEUNIT::SubFloop); CODEUNIT.RUN(CODEUNIT::SubFloop); END; 3: BEGIN SubFloop.FunctieFloop; SubFloop.FunctieFloop; END; 4: BEGIN IF SubFloop.RUN THEN; IF SubFloop.RUN THEN; END; 5: BEGIN IF CODEUNIT.RUN(CODEUNIT::SubFloop) THEN; IF CODEUNIT.RUN(CODEUNIT::SubFloop) THEN; END; END;
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.Regards
Peter0 -
pdj wrote:DenSter> It seems you are missing the point. We are not talking about ERROR but the simple MESSAGE. Have you ever seen it documented that it can stop a transaction?
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:0 -
pdj wrote:I agree that 1 and 4 should be considered a bug.
The original code was:MESSAGE('hi'); BEEP(100,100);
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.pdj wrote:Case 2 and 3 and 5 result in
BEEP,BEEP,Message,Message
While Case 1 and 4 results in
BEEP,Message,BEEP,Message0 -
actually:
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...®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
DenSter wrote:I would say that all reported cases are false.:
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 withcust.find('-'); cust.modify;
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.DenSter wrote:Am I losing my mind???? :shock:Regards
Peter0 -
Well, I think DenSter IS losing his mind.....
By the way:
The problem DOESN'T occur in 2.60!!!!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions