Number Series assignment on the request form of a report

rsaritzky
Member Posts: 469
Hi,
Has anyone ever tried to assign a number from a number series to a field on the request form of a report? I'm doing an Excel import via a ProcOnly report that imports lines into a temporary "staging" table that ultimately gets imported into a Purchase Order document. I want to insert an assigned document number into the staging table record, but show that number to the user prior to them running the process.
When I call NoSeriesMgt.InitSeries from the requet form, I receive the error:
"You cannot make any changes in the database until a transaction has been started."
The error message totally makes sense to me, but I'm wondering if anyone has figured out a workaround.
Thanks
Has anyone ever tried to assign a number from a number series to a field on the request form of a report? I'm doing an Excel import via a ProcOnly report that imports lines into a temporary "staging" table that ultimately gets imported into a Purchase Order document. I want to insert an assigned document number into the staging table record, but show that number to the user prior to them running the process.
When I call NoSeriesMgt.InitSeries from the requet form, I receive the error:
"You cannot make any changes in the database until a transaction has been started."
The error message totally makes sense to me, but I'm wondering if anyone has figured out a workaround.
Thanks
Ron
0
Comments
-
this type error comes when we have modify a record more than one time in a single process so check it.
Vijay Gupta0 -
Do you have to do this on the Request Form?
Couldn't you do this OnPreReport, or even OnPreDataItem of the first data item, and then tell the user what the document number is as follows:
IF NOT CONFIRM(DocumentNumber) THEN
ERROR('');
(CurrReport.QUIT doesn't always seem to work.)Alastair Farrugia0 -
You'll want to use your code later on in the report.
I've always assumed this is because of table locking. Think of it this way: If you called a lock table on the number series in the OnInit trigger of a report, and that user walked away without closing the report or running it, your system is basically down.0 -
matttrax wrote:You'll want to use your code later on in the report.
I've always assumed this is because of table locking. Think of it this way: If you called a lock table on the number series in the OnInit trigger of a report, and that user walked away without closing the report or running it, your system is basically down.
Yeah, I get it. But this is a little bit unusual scenario - I just want to get the next incremental document number - but it's not a "controlled" document number, i.e. I don't really care if they grab a doc number then close the report - an unused document number really doesn't matter in this case. So on the request form, I want to get a table value, increment it and save. But I'm inferring from my observation and everyone's comments that you can't do this.
I'll do the next best thing as one of you suggested - assign the doc number after they click "OK" to start running the report.
Thanks for everyone's comments.Ron0 -
Which trigger are you calling this from?David Singleton0
-
David Singleton wrote:Which trigger are you calling this from?
Ont the request form, I have a text box with a SourceExpr = DocNo
I put the following code in the "OnActivate" trigger for this control:
IF DocNo = '' THEN
IF CONFIRM('Do you wish a document number for this spreadsheet to be automatically assigned?', FALSE)
THEN
IF DocNo = '' THEN BEGIN
NoSeriesMgt.InitSeries(SSNoSeries,SSNoSeries,TODAY,DocNo,SSNoSeries);
END;Ron0
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