REPORT.SAVEASHTML problem

charlp
Member Posts: 21
I run Navision 3.7 client to do development in a 3.6 Navision database.
I have the following problem, and hope somebody can shed some light on this for me:
We had our purchases & payables section customised, and a Goods Returned items was added. This form makes use of a header and lines table respectively.
The header table has amongst others, two fields for the record number. The [No.] field initially contains a pre-post number for the goods returned note, while the [Pre-Assigned No.] field contains the post-post number. During the posting procedure, the two numbers are swopped.
I would like to email a HTML representation of the goods returned note to various users. For that, I created a report.
After the goods returned note is successfully posted, I run a procedure to create the HTML file, and email that off. So, from start to finish, the whole posting and emailing process happens in one transaction.
My problem is this:
If I run the report like this -
The fields identified by the error message are from the header record BEFORE the post. If I debug and look at the actual record just before the report is run, the UnPosted/Posted field contains the value 'Posted' , while the No. field contains 'GRP05324'.
This leads me to believe that somehow, the copy of the header table used in report 50072, when using the REPORT.SAVEASHTML method, is out of sync with the header table after the posting was done. To try and remedy this, I've tried to do a COMMIT followed by a SELECTLATESTVERSION after the posting procedure and before the report is generated. This had no effect. So now I'm stuck!
Has anybody ever had a similar issue with REPORT.SAVEASHTML, and if so, how do I solve this?
Thanks,
Charl
I have the following problem, and hope somebody can shed some light on this for me:
We had our purchases & payables section customised, and a Goods Returned items was added. This form makes use of a header and lines table respectively.
The header table has amongst others, two fields for the record number. The [No.] field initially contains a pre-post number for the goods returned note, while the [Pre-Assigned No.] field contains the post-post number. During the posting procedure, the two numbers are swopped.
I would like to email a HTML representation of the goods returned note to various users. For that, I created a report.
After the goods returned note is successfully posted, I run a procedure to create the HTML file, and email that off. So, from start to finish, the whole posting and emailing process happens in one transaction.
My problem is this:
If I run the report like this -
REPORT.RUN(50072, FALSE, FALSE, GoodsRetHeader)the report prints fine, but if I use -
REPORT.SAVEASHTML(50072, FilenameHTML, FALSE, GoodsRetHeader)I get the following error:
The E-M Purch. Goods Ret. Header does not exist.
Identification fields and values:
UnPosted/Posted='Unposted',No.='GRR05507'
The fields identified by the error message are from the header record BEFORE the post. If I debug and look at the actual record just before the report is run, the UnPosted/Posted field contains the value 'Posted' , while the No. field contains 'GRP05324'.
This leads me to believe that somehow, the copy of the header table used in report 50072, when using the REPORT.SAVEASHTML method, is out of sync with the header table after the posting was done. To try and remedy this, I've tried to do a COMMIT followed by a SELECTLATESTVERSION after the posting procedure and before the report is generated. This had no effect. So now I'm stuck!
Has anybody ever had a similar issue with REPORT.SAVEASHTML, and if so, how do I solve this?
Thanks,
Charl
0
Comments
-
Did you try saveasXML?0
-
Yes, with the same result.
It seems that the table's key gets renamed during the post procedure, but even if I make use of temporary tables to get the data to the report (with the report also printing from a temp table), I still get the same error.
There is definately something wrong with these two functions, because the RUN and RUNMODAL functions works fine.
Charl0 -
Finally solved this one!
It seems that the posting routine creates a new record for the posted return, using the info from the unposted return record.
Once the posting routine finishes, the unposted record gets deleted. Now, this doesn't seem to be a problem for printed reports, but an error occurs when you try to run the SAVEASHTML or SAVEASXML functions. I even created a dataport which I tried to run using the RUN and RUNMODAL functions. Both caused the same error.
So, my solution : just add the deleted record back into the table again, run my report, then delete it again.
Bada bing! Problem solved!!0 -
I still don't see how they would behave differently. But if it works it work.
:roll: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