IMobilePublishObject.FormatVersion

Fore Syntax

FormatVersion: Integer;

Fore.NET Syntax

FormatVersion: integer;

Description

The FormatVersion property returns information about the version of the object published in the mobile application.

Comments

The value of the FormatVersion property is used by the mobile application to determine if it is compatible with this object.

Fore Example

Executing the example requires that the repository contains a mobile application with the MA_PUB identifier. Add links to the Metabase, Mobile system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Mobile: IMobileApplication;
    Publicator: IMobileApplicationPublicator;
    MaPubObs: IMobileApplicationPublishObjects;
    i: Integer;
    MaPubObj: IMobileApplicationPublishObject;
    PublishObject: IMobilePublishObject;
    formatVersion: integer;
Begin
    mb := MetabaseClass.Active;

    // Get published mobile application
    Mobile := mb.ItemById("MA_PUB").Bind As IMobileApplication;
    
// Create a mobile application publisher
    Publicator := Mobile.CreatePublicator;
    
// Get mobile application objects
    MaPubObs := Publicator.Items;
    
For i := 0 To MaPubObs.Count - 1 Do
        MaPubObj := MaPubObs.Item(i);
        
If MaPubObj.IsValid Then
            PublishObject := MaPubObj.PublishObject;
            
// Display objects version
            formatVersion := PublishObject.FormatVersion;
            Debug.WriteLine(
"Name: " + PublishObject.Object.Name);
            Debug.WriteLine(
"Version of a published object: " + formatVersion.ToString);
        
End If;
    
End For;
End Sub UserProc;

Example execution result: the console window displays the names of mobile applications to be published.

Fore.NET Example

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Mobile;

...

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    Mobile: IMobileApplication;
    Publicator: IMobileApplicationPublicator;
    MaPubObs: IMobileApplicationPublishObjects;
    i: Integer;
    MaPubObj: IMobileApplicationPublishObject;
    PublishObject: IMobilePublishObject;
    formatVersion: integer;
Begin
    mb := Params.Metabase;
    // Get published mobile application
    Mobile := mb.ItemById["MA_PUB"].Bind() As IMobileApplication;
    // Create a mobile application publisher 
    Publicator := Mobile.CreatePublicator();
    // Get mobile application objects
    MaPubObs := Publicator.Items;
    For i := 0 To MaPubObs.Count - 1 Do
        MaPubObj := MaPubObs.Item[i];
        If MaPubObj.IsValid Then
            PublishObject := MaPubObj.PublishObject;
            // Display objects version
            formatVersion := PublishObject.FormatVersion;
            System.Diagnostics.Debug.WriteLine("Name: " + PublishObject.Object.Name);
            System.Diagnostics.Debug.WriteLine("Version of published object: " + formatVersion.ToString());
        End If;
    End For;
End Sub;

Example execution result: the console window displays the names of mobile applications that are published using the scheduled tasks container.

See also:

IMobilePublishObject