Click or drag to resize

IScriptingEventsOnCurrentRelationBeforeSave 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 OnCurrentRelationBeforeSave()
Examples

Description

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

VB
Sub OnCurrentRelationBeforeSave
' requires a userdefined field named
' "Mother company" as chech box defined on company


  If soapp.CurrentRelation.SourceTable = 5 Then  'the source of the relation is a company
    If soapp.CurrentRelation.ActiveText = "owns" Then
       soapp.CurrentContact.udef.ByName("Mother company").value = True
    End If
  End If

End Sub

See Also