IMetabaseCustomExtender.FindByClassId

Fore Syntax

FindByClassId(ClassId: Integer) : IMetabaseCustomClass;

Fore.NET Syntax

FindByClassId(ClassId: integer) : Prognoz.Platform.Interop.Metabase.IMetabaseCustomClass;

Description

The FindByClassId method searches for the class by numeric identifier of custom repository object.

Fore Example

Executing the example requires the custom repository object with the CUSTOM_OBJECT identifier.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    Extender: IMetabaseCustomExtender;
    Custom: IMetabaseCustomClass;
Begin
    MB := MetabaseClass.Active;
    Extender := MB.SpecialObject(MetabaseSpecialObject.CustomExtender).Edit 
As IMetabaseCustomExtender;
    Custom := Extender.Classes.FindByClassId(MB.ItemById(
"CUSTOM_OBJECT").ClassId);
    text := Custom = 
Null ? "Null" : Custom.Name;
End Sub UserProc;

After executing the example the class will be searched by identifier. In case if description is obtained, it will be displayed to the form header.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Extender: IMetabaseCustomExtender;
    Custom: IMetabaseCustomClass;
Begin
    MB := Self.Metabase;
    Extender := MB.SpecialObject[MetabaseSpecialObject.msoCustomExtender].Edit() 
As IMetabaseCustomExtender;
    Custom := Extender.Classes.FindByClassId(MB.ItemById[
"CUSTOM_OBJECT"].ClassId);
    text := Custom = 
Null ? "Null" : Custom.Name;
        
End Sub;

See also:

IMetabaseCustomExtender