To set up the operations that will be available for custom class objects, use the Operations tab in the The <class name> Class dialog box.
The table displays standard operations by default that cannot be edited or deleted.
Access permissions can be granted both to custom operations and standard operations. For details see the Additional Security Parameters section.
The maximum allowed number of custom operations that can be created is 11.
Operations are handled using the custom class implemented in one of the repository units. Operation handler methods must have the following signature:
Sub <OperationIdentifier>(<Parameter>: IMetabaseObjectDescriptor);
In the web application one can select a unit and a class in the Handler Without Visual Components and Class drop-down lists. In the desktop application one can select a unit and a class on the Operation Handlers tab. There are differences presented below that depend on where the work is executed.
The list of system operations available in the web application:
CREATEOBJECT
OPEN
EDIT
DELETE
PASTE
Web forms can be used to handle operations. A web form can be selected in the Web Form drop-down list of the required operation. The OPEN and EDIT events are always handle in a web form. The DELETE and PASTE events are always handled in a custom class. The CREATEOBJECT event and any other custom events can be handled both in a web form and in a custom class. If a web form is not selected, an event is handled in a custom class. For details about setting up web forms see the Using Web Forms for Handling Custom Class Operations subsection.
The list of system operations available in the desktop application:
OPEN
OPENWITHPARAMS
EDIT
DELETE
PASTE
The EDIT operation is handled on creating and editing a custom class object.
The Operation Handlers tab is used to specify a custom class:
In the Unit drop-down list select a unit/form/assembly, and in the Class drop-down list select a class containing operation handler implementations.
If parametric objects are supposed to be created, methods with the WithParams postfix and the following signature should also be determined:
Sub <OperationIdentifier>WithParams(<Parameter1>: IMetabaseObjectDescriptor; <Parameter2>: IMetabaseObjectParamValues);
In the object navigator operations for objects are available if the following conditions are met:
The user has permissions to execute the operation
The class includes a procedure to handle the operation.
Specifying the script that handles web application operations is no loner supported and is kept for compatibility with previous platform versions.
The examples of operation handler classes:
Class WebOperations: Object
Sub Createobject(ObjDesc: IMetabaseObjectDescriptor);
Begin
// Handle the Create operation
End Sub Createobject;
Sub Open(ObjDesc: IMetabaseObjectDescriptor);
Begin
// Handle the Open operation
End Sub Open;
Sub Edit(ObjDesc: IMetabaseObjectDescriptor);
Begin
// Handle the Edit operation
End Sub Edit;
Sub Paste(ObjDesc: IMetabaseObjectDescriptor);
Begin
// Handle the Paste operation
End Sub Paste;
Sub Delete(ObjDesc: IMetabaseObjectDescriptor);
Begin
// Handle the Delete operation
End Sub Delete;
Sub Custom1(ObjDesc: IMetabaseObjectDescriptor);
Begin
// Handle custom operation
End Sub Custom1;
Sub Custom2(ObjDesc: IMetabaseObjectDescriptor);
Begin
// Handle custom operation
End Sub Custom2;
End Class WebOperations;
Class Operations: Object
Sub Open(Obj: IMetabaseObjectDescriptor);
Begin
// Handle the Open operation
End Sub Open;
Sub Edit(Obj: IMetabaseObjectDescriptor);
Begin
// Handle creating the custom class object or operation Edit
End Sub Edit;
Sub Delete(Obj: IMetabaseObjectDescriptor);
Begin
// Handle the Delete operation
End Sub Delete;
Sub Paste(Obj: IMetabaseObjectDescriptor);
Begin
// Handle the Paste operation
End Sub Paste;
Sub CLS1OP1(Obj: IMetabaseObjectDescriptor);
Begin
// Handle the first custom operation
End Sub CLS1OP1;
Sub CLS1OP2(Obj: IMetabaseObjectDescriptor);
Begin
// Handle the second custom operation
End Sub CLS1OP2;
End Class Operations;
See also: