HI,I include these codes in my agent to deal with attachment and re-save document. but it works when run it manually. it does not work when run it scheduelly, the document can not be saved from backend.
I think the schedule agent can not recognize the c drive, but manually run can.
Does anybody have any idea to let schedule agent to recognize the local c drive? Thanks a lot,
Forall f In docA.Items
Select Case f.Type
Case 1084
Set obj=docA.GetAttachment(f.values(0))
If Not obj Is Nothing Then
If newcorpdoc.GetAttachment(f.values(0)) Is Nothing Then
Call obj.ExtractFile("c:\"+f.values(0))
Call rtitem.AddNewLine(1,False )
Set object= rtitem.EmbedObject( EMBED_ATTACHMENT, "", "c:\"+f.values(0))
Kill "c:\"+f.values(0)
Call obj.Remove
End If
End If
End Select
End Forall
Subject: Why my codes get different result from manually run and scheduled run?
Is the agent signed by an ID (you) who has unrestricted access? You will likely need unrestricted access to write to the C drive.
I sure you know, as it’s running on a server, it will be writing to the servers C drive and not your local drive (hence why the unrestricted requirement).
If you eventually want to write to a network drive, don’t forget you will also need to consider network security also.
Subject: RE: Why my codes get different result from manually run and scheduled run?
The ID that is running the agent needs to have “Unrestricted” access on the server. Those who have the access is set in the server document:
Open your corporate address book (not your personal) or your test environments.
On the left navigator choose > Configuration > Servers > All Server Documents
Locate and open the document for the server you’re running the scheduled agent.
Click on the security tab and on the top of the right column you should see who can run unrestricted methods and operations.
When you write to the C drive from the server this requires unrestricted access. To learn more go to help in designer and look-up unrestricted and open the document Restricted LotusScript and Java agent operations.