Problem with TransactionType in NAV 2009 RTC

hav
Member Posts: 299
Hi All,
I have written a codeunit with below function whose purpose is to cancel reservations and refresh the firm planned produciton order having source as FamilyNo passed as an argument.
When i run NAV 2009 Classic Client, the function is executed properly and the respective Firm Planned Production Order is refreshed to carry out reservation of required stocked components.
However, if i test this function in NAV 2009 RTC, it generates error as below:
The error is generated at the line where i change the transaction type
i.e.
COMMIT;
CURRENTTRANSACTIONTYPE := TRANSACTIONTYPE::Update;
Before COMMIT, the transactiontype is UpdateNoLocks, which i change it to Update after the COMMIT so that the report "Refresh Production Order" runs in Update mode.
I am not sure why the error appears in RTC only inspite of the fact that i have changed the transaction type from UpdateNoLocks to Update.
If i do not put the COMMIT and do not set the transaction type then the same error is displayed in both Classic Client and RTC and the report is not executed.
Any idea what is going wrong here?
Regards,
Hemant
I have written a codeunit with below function whose purpose is to cancel reservations and refresh the firm planned produciton order having source as FamilyNo passed as an argument.
CancelAndRefreshProdOrder(FamilyNo : Text[30]) //Purpose: Reserve the stock for the FamilyLines by refreshing the Production Order. //Input: Family Number //Output: Stock reserved only for the FamilyLines present in the Family record. COMMIT; ProductionOrder.RESET; ProductionOrder.SETRANGE(Status, ProductionOrder.Status::"Firm Planned"); ProductionOrder.SETRANGE("No.", FamilyNo); IF ProductionOrder.FIND('-') THEN BEGIN ReservEntry.RESET; ReservEntry.SETRANGE(ReservEntry."Source ID", ProductionOrder."No."); ReservEntry.SETRANGE("Reservation Status", ReservEntry."Reservation Status"::Reservation); IF ReservEntry.FIND('-') THEN BEGIN REPEAT ReservEngineMgt.CloseReservEntry2(ReservEntry); COMMIT; UNTIL ReservEntry.NEXT = 0; END; COMMIT; CURRENTTRANSACTIONTYPE := TRANSACTIONTYPE::Update; ProdOrder.RESET; ProdOrder.SETRANGE(Status, ProdOrder.Status::"Firm Planned"); ProdOrder.SETRANGE("No.", ProductionOrder."No."); REPORT.RUNMODAL(REPORT::"Refresh Production Order",FALSE,TRUE,ProdOrder); COMMIT; END;
When i run NAV 2009 Classic Client, the function is executed properly and the respective Firm Planned Production Order is refreshed to carry out reservation of required stocked components.
However, if i test this function in NAV 2009 RTC, it generates error as below:
The error is generated at the line where i change the transaction type
i.e.
COMMIT;
CURRENTTRANSACTIONTYPE := TRANSACTIONTYPE::Update;
Before COMMIT, the transactiontype is UpdateNoLocks, which i change it to Update after the COMMIT so that the report "Refresh Production Order" runs in Update mode.
I am not sure why the error appears in RTC only inspite of the fact that i have changed the transaction type from UpdateNoLocks to Update.
If i do not put the COMMIT and do not set the transaction type then the same error is displayed in both Classic Client and RTC and the report is not executed.
Any idea what is going wrong here?
Regards,
Hemant
Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
0
Comments
-
Hey guys,
Is there anything to do with hiding the report request form by passing the argument as false when i call the report to run modally?REPORT.RUNMODAL(REPORT::"Refresh Production Order",FALSE,TRUE,ProdOrder);
The 2nd argument above.
I also noticed that the TransactionType property of the report "Refresh Production Order" is set to Update.
So do i explicitly need to change the transactiontype before running the report?Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)0 -
This is creating a mystery for me and i am unable to fix it.
Pls help.Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)0 -
I think I have a good idea.
I think you are running NAV2009 without SP1.
The COMMIT statements do NOT do a COMMIT in the webservices (and RTC uses webservices to connect to the database). So in reality you are NOT doing a COMMIT where your COMMIT-statement is and thus your transaction is NOT closed. And you can't change the transaction type in the middle of a transaction.
There is a bugfix for that problem, but I don't know the KB or the build of NAV for it (I have it all on my dead portable). If you open a request in Microsoft stating you want the bugfix for the COMMIT that does not do a COMMIT in the webservices, they 'll know what you need.
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi Kriki,
Thanks for your reply.kriki wrote:I think you are running NAV2009 without SP1.
I am using NAV 2009 NA SP1kriki wrote:If you open a request in Microsoft stating you want the bugfix for the COMMIT that does not do a COMMIT in the webservices, they 'll know what you need.
Regards,
HemantRegards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)0 -
Sorry it took so long, but there was Directions EMEA 2010 and a portable crash in between...
No, you have to go on partnersource and create a request there.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi, here could you find the solution: https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?WTNTZSMNWUKNTMMYYMYQKSYMXOSOOUMLWQOVNNOWZUMLSYZMNOURUYYKVTSMNQKL. You have to click the View and request hotfix downloads.
I was trying to run report after filtering records into temporary table and the RTC client returned the same error. After instalation (copying of files) of this hotfix and inserting Commits it is working.
Hope, this helps...0 -
I am using NAV 2009 SP1 hence i think the hotfix should be included in it.
Regards,
HemantRegards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)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