I have the code below that currently saves a file to the
C:\Documents and Settings\All Users\Application Data\Microsoft\Microsoft Dynamics NAV\60\Server\WLC\"USERID" folder on the computer of the middle tier. This code works. I would like to save the file to a shared drive on another computer. The middle tier service account has rights to the share drive both in folder permissions and share permissions. I have experimented with the DOWNLOAD function, but need to do this without the user getting involved.
The exact error I get in the RTC is
"Either the caller does not have the required permission or the specified path is read-only."
Here is the code
// folder on share drive
WorkingDir := '\\neptune\shared\ProdRep\FTP';
IF NOT Item.GET(ItemNo) THEN
EXIT;
Delim := '|';
FileName := (WorkingDir+'\10000001.888');
ExportFile.CREATE(FileName);
ExportFile.TEXTMODE(TRUE);
WITH Item DO
ExportFile.WRITE(
'PMF' + Delim +
"No." + Delim +
Description + "Description 2");
ExportFile.CLOSE;
Thanks in advance for your help.
Joe
(Solved using detlaf's solution below. Thanks to all)
Joe
0
Answers
DOWNLOAD(FromFile, DialogTitle, ToFolder, ToFilter, ToFile)
Check out the helpfile for more info. It works like a champ for me. Otherwise you might want to write a server side script to move the files over to your network drive on a timed basis. I couldn't get an RTC instance to write directly to a network drive.
- In Active Directory Users and Computers open the properties of the user running the NAV Server Service.
- Select the delegation Tab
- Click on Add
- Click Users and Computers...
- Type in the server name that has the share
- Select cfis (if its not there, you need to add the SPN) - HOST may work as well
I solved it by adding the following two SPNs to the Service User of the Service Tier:
HTTP/ServiceTierServername
HTTP/ServiceTierServername.FQDN
And in in setting the delegation to "Trust this user for delegation to any service (Kerberos only)"
Maybe it is possible to restrict the delegation to the HTTP service, but as I need the Enterprise Admins to evaluate this, I just use "any service" :-)
But I need to try detlefs solution as well...
I had the same problem, but the user running rtc services in local system account. How I could apply delegation to this user? In Active Directory can´t find Local System account because it´s protected.
Thx!
Use Network Service account instead of Local System. Then add Delegation for the Server running the NAV Service in Active Directory.