Click or drag to resize

IScriptingEventsOnCurrentSelectionBeforeSave Method

Called when Save has been triggered, but before anything is saved to the database.

Namespace:  SuperOffice.COM.ScriptEvents
Assembly:  Scripting.Interop (in Scripting.Interop.dll) Version: 8.0.0.0
Syntax
void OnCurrentSelectionBeforeSave()
Examples

Description

This text may be copied to the notepad, and saved as a *.vbs file.

VB
Sub OnCurrentSelectionBeforeSave

dim selMembs
Dim ownCont
Dim theAppnt
Set selMembs = soapp.CurrentSelection.SelectionMembers
Dim item As SOSelectionMember
For Each item In selMembs
    If item.Contact.Identity = soapp.Database.OwnerContactId Then
        Set ownCont = soapp.Database.GetContact(soapp.Database.OwnerContactId)
         Set theAppnt = soapp.Database.CreateAppointment
         theAppnt.SetDefaults
         theAppnt.Contact = ownCont
         theAppnt.Description = "Owner contact was added to the following selection: " & soapp.CurrentSelection.Name
         theAppnt.Save
    End If
Next

End Sub

See Also