LS Agent to just EditSave the CalendarProfile

Hello,

Would you please see why my LS Agent does not function as my Formula Agent for just open edit and save the only profile document in the Notes mail template.

Please see if I missed anything from the scripts please tell me what is the proper code

for just open the calendar profile in edit mode then save and close it.

Thanks a lots for your time!

Myle

1 This Formula Agent to open Profile document just do Edit then Save - working from UI .

==========================================================================

@Command( [EditProfileDocument] ;(“CalendarProfile”));

@Command([FileSave]);@Command([FileCloseWindow]);

SELECT @All

==========================================================================

I converted into LotusScript it does not work at all

==========================================================================

Option Public

Option Declare

Sub Initialize

Dim workspace As New NotesUIWorkspace

Dim db As NotesDatabase 

Dim docProfile As NotesDocument 	

Dim session As New NotesSession



Set db = session.currentDatabase 

Set docProfile = db.GetProfileDocument("CalendarProfile")  	

Call workspace.EditProfile (docProfile)  

Call docProfile.save(True,False) 			

End Sub

==========================================================================

Subject: You don’t pass a NotesDocument to EditProfile…

Set notesUIDocument = notesUIWorkspace.EditProfile( profileName$ [, uniqueKey$] )So you would just use ui.EditProfile(“CalendarProfile”)

Subject: RE: You don’t pass a NotesDocument to EditProfile…

First of all Happy new Year to you.

Thanks for watching over folks like me.

I actually use this LS from the UI but I need to have it automaticcally close too, I think I need to use different approach then.

================================

Sub Initialize

Dim workspace As New NotesUIWorkspace

Dim session As New NotesSession

Call workspace.EditProfile(“CalendarProfile”)

=====> I think I need a command here to close the profile??

End Sub

============================

Thanks Bill!

Myle

Subject: Ah, your previous post is letting me see what you are trying to do…

You want to update the Profile doc in the background on the Server at 1:00 AM. Try this code instead.

Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase 'Or whatever db you want
Set doc = db.GetProfileDocument(“CalendarProfile”)

Call doc.ComputeWithForm(True, False)

Call doc.Save(True, False)

Subject: Thanks Bill !! - problems always solved when you’re around.

Thanks to my true LS Master -

I’m greatly Appreciated your HELP

Myle

Subject: I have no idea why that works… but you’re wonderful

From my reading of the help, ComputeWithForm has two parameters, the first one being completely ignored. Therefore ComputeWithForm(True, False) is the same as ComputeWithForm(False, False)

So why the difference in functionality between the two?

Notes. Sheeesh!

Tim

Subject: LS Agent to just EditSave the CalendarProfile

the Workspace EditProfile method takes a String, not a Notesdocument as its parameter

try

call workspace.EditProfile(“CalendarProfile”)

That is going to make it the UIDoc until you save and close it in the UI.

You script doesn’t really show you doing anything with it after you get it anyway besides saving. What are you really trying to accomplish?

Dana

Subject: RE: LS Agent to just EditSave the CalendarProfile

Thanks Dana,

You see my point, I hope this is the only way I can refresh the profile document by schedule this agent at 1:00 AM from the server. Open the profile document in the edit mode then just save and close. If I use front end UI I guess I cannot schedule this agent right?

Myle