Previous Topic

Next Topic

Inhoudsopgave

Book Index

IsahObjects.Get

Method Method Get(ClassName: String): Object

Description

Use the IsahObjects.Get method to create an object instance. Calling the Get method creates an instance of a requested class and returns a reference to the created object.

Parameters

Note: In principle, you can use the IsahObject.Get function to activate an instance of any Isah screen. The screen is then included as the parameter of the IsahObject.Get function (see example 1 below). It is, however, recommended that you only use the IsahObject.Get function for opening instances of Isah processes (see example 2 below) and the standard Isah Info form, Isah Edit form and Isah Process form.

Example

Dim btnStart

Sub Main()

rem Activates an instance of the process:

rem Copy calculation from parts archive to production file

set frm0130 = isahobjects.get("FRM0130")

rem Open the Object Inspector to view all object details

frm0130.inspectorview

rem Set pointer to btnStart:

rem 1) To prevent premature destruction of the invoke object

rem 2) This reference is required to run the "original" OnClick event

rem in the new OnClick event.

Set btnStart = frm0130.btnStart

rem Since btnStart was not created by the script, specify

rem that a script is available

btnStart.Script = Script

rem Assign the OnClickEvent

btnStart.OnClickEvent = "OnClickButton"

rem Since this custom script cannot be run in batch

rem (it is form based and not process data module based)

rem The batch button must be disabled

frm0130.BatchVisible = false

rem Specify the default values of the process

rem Modify the interface

frm0130.dmIsahProcess.tblMemoryFromPartCode.Value = "0"

rem Following line shows how you could change the stored proc

rem frm0130.dmIsahProcess.spProcess.StoredProcName =

rem "SP_PRC_CUSTOM"

frm0130.gbRevisionInfo.Visible = false

rem Closes the Process screen when the user clicks OK

rem For additional information on ModalResult see ShowModal in Isah VBScripting

btnStart.ModalResult = 1

rem Displays the screen

frm0130.ShowModal

rem Informs the script engine that the set pointer is no longer

rem needed. This is required, because objects would otherwise

rem remain stored in memory

Set btnStart = nothing

Set frm0130 = nothing

end sub

sub OnClickButton()

rem Modifies the process

msgbox "Before standard processing"

rem Optional, calls the standard process

btnStart.OldClick

msgbox "After standard processing"

end sub

Sub ShowInspector( anObjToInspect )

set ObjInspector = isahobjects.get("TFRM0904")

ObjInspector.ObjectToInspect = anObjToInspect

ObjInspector.ShowModal

set ObjInspector = nothing

End Sub

Example

Sub Main()

Dim ProcessObject

Set ProcessObject = IsahObjects.Get("PRC0027")

ProcessObject.SetParam "PRODHEADERDOSSIERCODE" , "PD-00-0023"

ProcessObject.SetParam "CALCPRECALC" , True

ProcessObject.SetParam "CALCPOSTCALC", True

ProcessObject.IsahStart

End Sub