ILicenseManager.CheckoutCommuterLicense

Syntax

CheckoutCommuterLicense(FeatureName: String): UiLicenseStatusCode;

Parameters

FeatureName. Feature name.

Description

The CheckoutCommuterLicense method checks out a local license, enabling to use the application offline, from license server.

Comments

The method is relevant when a network license is used that enables the user to check out temporary local licenses.

After the expiry of the use period, license should be checked in to license server using the ILicenseManager.CheckinCommuterLicense method. If license server is limited by number of users, on checking out temporary license the number of simultaneously working users is reduced to one and on checking in the license the number of simultaneously working users is restored.

NOTE. Some network licenses enable the use of application offline up to 30 days, for example, to be used on laptops during business trips. To do it, the network license enables the user to check out temporary local license.

Example

To execute the example, place the Button and Editbox buttons named Button1 and Editbox1 on the form.

Add links to the Host, Ui, Forms system assemblies.

The example is a handler of the OnClick event for the Button1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    LicManager: ILicenseManager;
    Feature: String;
    FeatureInfo: ILicenseFeatureInfo;
    StatusCode: UiLicenseStatusCode;
Begin
    LicManager := WinApplication.Instance.LicenseManager;
    Feature := EditBox1.Text;
    FeatureInfo := LicManager.FeatureInfo(Feature);
    
If FeatureInfo.CommuterAllowed Then
        StatusCode := LicManager.CheckoutCommuterLicense(Feature);
        
If StatusCode = UiLicenseStatusCode.Success Then
            WinApplication.InformationBox(
"License is successfully checked out");
        
Else
            WinApplication.InformationBox(
"Error: " + StatusCode.ToString);
        
End If;
    
End If;
End Sub Button1OnClick;

Enter name of the preinstalled feature into Editbox, for example, PP_OLAP, and click the button. A temporary local license is checked out for the specified feature, if it is possible, and a message with temporary license checkout result is also displayed or with the code of occurred error.

See also:

ILicenseManager