Auto config Calendar profile!

Hi

I tried to create a server agent that changes the calendar autoprocess fields in the calendar profile of all the mail databases.

That way all of our users have the same settings.

But it don’t work before the user opens the calendar profile and saves it!

Have anyone tryed that or can anyone tell me that I am doing wrong!

'//AutoProcess Calendar entries

		nDocPre.AutoProcessConflictOptions = "1"

		nDocPre.AutoProcessForwardTo = ""

		nDocPre.AutoProcessFromType = "0"

		nDocPre.AutoProcessMeetings = "1"

		nDocPre.AutoProcessType = "0"

		nDocPre.AutoProcessUserList = ""

		nDocPre.AutoRemoveFromInbox = "1"

		nDocPre.DeleteCSPref = "2"

		

		Call nDocPre.RemoveItem("AutoProcessTypeDisabled")

		Call nDocPre.RemoveItem("tmpAutoProcessEnabled")

		Call nDocPre.RemoveItem("tmpAutoProcessAction")

Subject: RE: Auto config Calendar profile!

But it don’t work before the user opens the calendar profile and saves it!

If it doesn’t work for you, you should describe exactly how it fails. Does your agent get an error message? Does the user whose mailbox it is get an error message? If so, what message? Use the Notes debugger, or debugging techniques described here to find out what line of code the error occurred on, and to discover the values of some relevant variables. If you don’t get an error message, than in what other way is it failing to do what you expect?

The code you posted doesn’t show how you locate the profile document or show you saving your changes. Either of those could easily be the cause of your problem.

What makes you think you should remove items as opposed to to setting them to “”?

Subject: RE: Auto config Calendar profile!

hiI don’t get any errors!

Some of our users have not enabled “automatic responses to meeting invitations” in the calendar profile document i the mail database.

Now we want to use the agent to set some defaults in the calendar profile without the users knowing. so the agent runs once a week to set the fields in the calendar profile the way we want (administrators).

Lets say the user have not enable the autoprocess. this means the then I book a meeting i his calendar it is not booked in the calendar right away (the user must accept in inbox). Now I run my agent (server side so it has manager rights to the mail file). Then I test again and the meeting still gets in the inbox. then I open the calendar profile in the users mail file. I can see that all the fields is set right the way I want.?? then I save the profile document and test again. Now the meeting gets booked in the calendar automatic.

Here is the script:

Dim ns As New NotesSession

Dim nDBCur As NotesDatabase

Dim nDBNAB As NotesDatabase

Dim nViewNAB As NotesView

Dim nColNAB As NotesDocumentCollection

Dim nDocNAB As NotesDocument

Dim nDBMail As NotesDatabase

Dim nDocPre As NotesDocument

Dim sMailServer As String

Dim sMailDatabase As String

On Error Goto errorhandler

Set nDBCur = ns.CurrentDatabase

Set nDBNAB = ns.GetDatabase(“dkny1”,“names.nsf”)

Set nViewNAB = nDBNAB.GetView(“($Company)”)

Set nColNAB = nViewNAB.GetAllDocumentsByKey(“IBS DK”,True)

Set nDocNAB = nColNAB.GetFirstDocument

While Not nDocNAB Is Nothing

sMailServer = nDocNAB.MailServer(0)

sMailDatabase = nDocNAB.MailFile(0)

Set nDBMail = ns.GetDatabase(sMailServer,sMailDatabase)

Set nDocPre = nDBMail.GetProfileDocument(“CalendarProfile”)

Call nDocPre.ReplaceItemValue(“$DialogMode”,Cint(“0”))

'//AutoProcess Calendar entries

nDocPre.AutoProcessConflictOptions = “1”

nDocPre.AutoProcessForwardTo = “”

nDocPre.AutoProcessFromType = “0”

nDocPre.AutoProcessMeetings = “1”

nDocPre.AutoProcessType = “0”

nDocPre.AutoProcessUserList = “”

nDocPre.AutoRemoveFromInbox = “1”

nDocPre.DeleteCSPref = “2”

Call nDocPre.RemoveItem(“AutoProcessTypeDisabled”)

Call nDocPre.RemoveItem(“tmpAutoProcessEnabled”)

Call nDocPre.RemoveItem(“tmpAutoProcessAction”)

'Call nDocPre.ComputeWithForm( False, False )

Flag = nDocPre.Save(True,True,True)

Set nDocNAB = nColNAB.GetNextDocument(nDocNAB)

Wend

Print “done”

Exit Sub

errorhandler:

Print "Fejl: "+Error()

Exit Sub

Subject: RE: Auto config Calendar profile!

I suppose there’s some change that happens to the profile document when the user opens it and saves it. Most likely there’s a computed field that you’re failing to set. You might use ComputeWithForm in your agent (easy but not terribly efficient). Or you can write a program to read your own profile document, and write a file containing the values of all the fields. Then change the settings you’re interested in and see what fields have changed and how.