Click or drag to resize
IQMSSaveCALConfiguration Method
Saves the CAL configuration.

Namespace: PIX.Services.V12
Assembly: 
Syntax
void SaveCALConfiguration(
	CALConfiguration calConfiguration
)

Parameters

calConfiguration
Type: PIX.QMSAPI.DataObjects.CALsCALConfiguration
The cal configuration.
Remarks
Not all fields in the configuration can be changed using this method. For all CAL types (Session, Document, Named and Usage), the Limit can be set. The maximum value is limited by the license on the QVS. The other fields that can be set are related to NamedCALs: NamedCalMode, AllowBorrowCal, AllowDynamicNamedCals and AssignedUsers.
Security note Security Note

Requires membership of local groups QlikView Management API and QlikView Administrator.

Examples
The following code example retrieves the CAL configuration for a QVS, changes a setting and saves it back.

The service key injection is assumed to be handled behind the scenes. For an example of how to inject the service key, see Samples.

C#
using System;
using System.Collections.Generic;
using System.Linq;
using QMSAPI;

class Program
{
    static void Main(string[] args)
    {
        try
        {
           // create a QMS API client
           IQMS apiClient = new QMSClient();

           //retrieve a time limited service key
           ServiceKeyClientMessageInspector.ServiceKey = apiClient.GetTimeLimitedServiceKey();

           //Some known QVS id
           Guid qvsId = new Guid("5ac16136-f00b-47c4-8099-23ff7f178423");

           CALConfiguration calConfiguration = apiClient.GetCALConfiguration(qvsId, CALConfigurationScope.NamedCALs);
           calConfiguration.NamedCALs.AllowDynamicAssignment = false;

           apiClient.SaveCALConfiguration(calConfiguration);
        }
        catch (Exception ex)
        {
            Console.WriteLine("An exception occurred: " + ex.Message);
        }
        // wait for user to press any key
        Console.ReadLine();
    }
}
See Also