Lotus Script Agent help

The code below works if I run it via the client. If I try to run this over the web it bombs. I was attempting to call the agent via the webqueryopen, but it does not work. The code is supposed to set NTuser field to the current NT user. AS mentioned it works fine via the client. I thought that it was permissions but the agent allows me to set the field to any text that I want, but not the NT user. I am new to script and appreciate any help thanks.

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim mydoc As NotesDocument	 

Dim NTuser As String





Set db = session.CurrentDatabase	

Set mydoc = session.DocumentContext	



'Declare a string long enough to pass to the DLL

Dim username As String*255

Dim finalusername As String

Dim returnval As Long

'The functions 1 if successful

returnval=getusername(username,Len(username))

'Strip out the null characters

finalusername=Left(username,Instr(username,Chr$(0))-1)







mydoc.NTuser=finalusername 



	'Save the changes		

mydoc.Save False, False			

End Sub

Subject: Lotus Script Agent help.

Is the agent set to run as web user?

Subject: Lotus Script Agent help.

There is no NTUser on the web (or for scheduled or runonserver agents) – the OS “user” is the server, and it doesn’t need or use a login id.

Subject: I don’t think he reads these responses. Check this thread…

and my response

Subject: And I don’t think you’re not right (was: RE:I don’t think he reads these responses. Check this thread…)

Subject: RE: I don’t think he reads these responses. Check this thread…

I do read the responses. I was a bit confused. Thanks for your help. I really appreciate it. :slight_smile:

Subject: Then I have a suggestion for you. If you did not understand my previous response,

Please make a response to it. When you post the exact same question a couple of days later, with no responses to our suggestions, I can only assume that you did not bother to read those responses. Most of the people who do take the time to respond to questions will find the updates you made to your original question.