Macros/Base/BaseFormOpen
Description
Code
Option Explicit
Global LibOForm as object
Sub FormOpen
ThisDatabaseDocument.CurrentController.connect("","")
LibOForm = ThisDatabaseDocument.FormDocuments.getByName("Instruments").open
LibOForm.currentController.frame.ContainerWindow.IsMaximized = True
End Sub ' FormOpen
Public Sub SF_FormOpen
Dim baseDoc As Object ' SFDocuments.Base service
Dim form As Object ' SFDocuments.Form service
GlobalScope.BasicLibraries.loadLibrary("ScriptForge")
baseDoc = createScriptService("SFDocuments.Base", thisDatabaseDocument) ' Base service
form = baseDoc.openFormDocument("Instruments") ' Form service
createScriptService("ScriptForge.UI").Maximize
End Sub ' SF_FormOpen
# coding: utf-8
from __future__ import unicode_literals
def FormOpen(*args):
doc = XSCRIPTCONTEXT.getDocument()
connection = doc.DataSource.getConnection('','')
form = doc.FormDocuments.getByName('Instruments').open()
form.CurrentController.Frame.ContainerWindow.IsMaximized = True
def SF_FormOpen(*args):
from scripforge import CreateScriptService as getSvc
baseDoc = getSvc("Base", thisDatabaseDocument) # SFDocuments.Base service
form = baseDoc.openFormDocument("Instruments") # SFDocuments.Form service
getSvc("UI").Maximize
Base file to test macro
- Download example ODB file containing Basic/Python scripts