I will make up a scenario here to simpify the issue im having...
I have a report which calls a function in a codeunit. The report is scheduled to run with the NAS once a day.
In the codeunit the function posts purchase orders by doing some processing then saying:
IF LUnitPurchPost.RUN(LRecPOHead) THEN BEGIN
//Some happy code here
END ELSE BEGIN
//Some unhappy code here
END;
(LUnitPurchPost is codeunit 90. Whenever I run the report manually all is good. However whenever the NAS runs it it always goes into the unhappy code. I can't see why. I've even logged in as the same user the nas uses to log in and posts POs manually to ensure they don't have errors there (permissions etc).
0
Comments
Run the codeunit without the if statement and check the event log and you'll see error. Most likely reason is window.open('. You need to write if GUIALLOWED then window.open,
window.update and window.close in CU 90.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Its seemingly inexplicable. Whenever I run my process manually it works a charm, but when run via the nas user it sometimes doesnt. Whenever it fails I can see the PO it failed on but if i go and manually post that po it works fine.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Thank you
Don't forgett, when you start the debugger on NAS the NAs runs with your windowslogin. so set before your windowslogin the same permissions like the originen NAS user or Start the NAS debug with the NAS WindowsLogin (Logon on Windows with the NAS account)
Regards