Hi,
I get following error when I run Refresh function from Released Prod. Order. I have to run 'Refresh' twice. The first time it runs I get below error. The second time everything runs perfectly.
"You cannot change the transaction type after you start the transaction.
A transaction starts when the program executes the first database operation, such as FIND, NEXT, INSERT, DELETE, MODIFY, SUM, and COUNT.
The error occurred because you were trying to change the transaction type from UpdateNoLocks to Update."
Refresh function calls "Refresh Production Order" report (ID 99001025) with Request Form.
REPORT.RUNMODAL(REPORT::"Refresh Production Order",TRUE,TRUE,ProdOrder);
The only thing I did is supressed the Request Form as below to directly run the Refresh process
REPORT.RUNMODAL(REPORT::"Refresh Production Order",FALSE,TRUE,ProdOrder);
I am using NAV 2009 R2 database, where the "Transaction Type" property is set to 'Update' in report 99001025 in standard NAV, as compared to '<UpdateNoLocks>' in 4 SP3. When I change this property to '<UpdateNoLocks>' it works fine.
The only doubt here is what is the role of RequestForm in all this. If the "Transaction Type" property is 'Update' and RequestForm = TRUE, system does not give error. But if the RequestForm = FALSE, system throws an error.
Any suggestions/opinions.
0
Comments
"Another user has modified the record for this Production Order after you retrieved it from the database.
Enter your changes again in the updated window, or start the interrupted activity again.
Identification fields and values:
Status='Released',No.='PRD063170'"
To resolve this I added 'LOCKTABLE' command in Production Order - OnPreDataItem trigger to resemble it to Transaction Type = 'Update'. It resolved the above error.
But my question is still same, How the RequestForm = TRUE/FALSE is impacting the Locking of table. If the "Transaction Type" = 'Update' in Report property and RequestForm parameter = TRUE in Report.Runmodal command, system does not give error. But if the RequestForm parameter = FALSE, system throws an error.
Please advice. Thanks.