Post Item Journal Line through NAS

HollandPoland
Member Posts: 62
Hello everyone!
My customer has to post item journal lines periodically. I create a report that it reads some lines and it creates records in to Item Journal Line table. I'd like to post these records but the job queue returns me an error that I cannot invoke dialogs.
Are there codeunits that I can invoke without dialog that they post Item Journal Line?
Thank you for your replies.
My customer has to post item journal lines periodically. I create a report that it reads some lines and it creates records in to Item Journal Line table. I'd like to post these records but the job queue returns me an error that I cannot invoke dialogs.
Are there codeunits that I can invoke without dialog that they post Item Journal Line?
Thank you for your replies.
0
Comments
-
The NAS does not managed GUI. So you cannot invoke dialogs during your process.
There is a function in navision to test the GUI. (GUIALLOWED)
So to run your process with nas you have to put GUIALLOWED before all dialogs.
Example :
IF GUIALLOWED THEN
Message('blablabla...');0 -
nromain wrote:The NAS does not managed GUI. So you cannot invoke dialogs during your process.
There is a function in navision to test the GUI. (GUIALLOWED)
So to run your process with nas you have to put GUIALLOWED before all dialogs.
Example :
IF GUIALLOWED THEN
Message('blablabla...');
Ok, I try it. Message and Error dialogs are need to be tested by GUIALLOWED function?0 -
Yes but it depends if you want your error to block the NAS process...0
-
Thak you, I resolve it whith this code before every dialog's function call (OPEN, UPDATE, CLOSE) and before every CONFIRM functon:
IF GUIALLOWED THEN Window.OPEN('something'); .... ....
0 -
I am trying to run the “Adjust Cost - Item Entries” and “Post Inventory Cost to G/L” reports through NAS (since the client found that Automatic Cost Adjustment was slowing down Navision too much).
I modified the code wherever a dialog is being opened, closed or updated, and I also set it up to write the time of completion in a table, so that I would know that the reports ran successfully.
When I run the modified reports manually, they work without any problem.
But when run through NAS, they hit the following error (reported in the Job Queue Log Entry):
Another user has modified the record for Post Value Entry to G/L Value Entry No. '43134' after you retrieved it from the database.
Re-enter the changes in the updated window or start the activity again.
I thought that the dialog might be doing an implicit Commit, so I tried adding a Commit after each (commented out) dialog open / update / close, to see if this makes a difference.
But I’m still getting the same error when it runs through NAS.
Do you know what I could do?Alastair Farrugia0 -
Is it the NAV-user that runns report? :-k
Sound like a possible permissionerrorRegards
Dan Lindström
NCSD Navision 2.00 since 1999 (Navision Certified Solution Developer)
MBSP Developer for Microsoft Dynamics NAV 20090 -
I restarted the NAS service and tested again - this time it ran without error.
I then commented out the COMMITs and tested again, and again it ran without error.
Note - I had made one other change besides commenting out the commits.
In the Post Inventory Cost to G/L report, I had commented out the following lines:IF TempCapValueEntry.FIND('-') THEN Window.OPEN(Text99000000);
but of course I should only have commented out the Window.OPEN (and put a ; instead).
So it was that bugfix, and the service restart that solved the problem. No need for any commits.
I'll check again next week, after the users have posted several transactions, but I'm pretty sure that the problem is solved now.
P.S. My NAS service runs as Administrator, Administrator is a Windows login with the SUPER role in Navision, and the error message doesn't mention any permissions, so it wasn't a permission problem.Alastair Farrugia0 -
-
No NAS can't run forms or dialogs, that's why I needed to comment out the Window.OPEN.
My problem was that I commented out another line too.
In general, we shouldn't even comment out the code, but put an IF condition as follows:IF TempCapValueEntry.FIND('-') THEN IF GUIALLOWED THEN Window.OPEN(Text99000000);
However, I had made a copy of Report 1002, which
(a) called report 795 and
(b) was only going to be called by NAS
So in this particular case it was OK to replace the Windows.OPEN with just a semicolon.Alastair Farrugia0 -
A short follow-up: besides the 2 reports (Adjust Cost - Item Entries, and Post Invt. Cost to G/L) there are also dialog boxes in codeunit 5895 (Inventory Adjustment) so we need to check for GUIALLOWED there too.Alastair Farrugia0
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