# SaveCALConfiguration Method

## Overloads

| [SaveCALConfiguration(CALConfiguration)](https://help.qlik.com/en-US/qlikview-developer/May2024/Subsystems/QMSAPIref/Content/PIX.Services.V12.Api8.IQMS8.SaveCALConfiguration.htm#PIX_Services_V12_Api8_IQMS8_SaveCALConfiguration_PIX_QMSAPI_DataObjects_CALs_CALConfiguration_) |  | Saves the CAL configuration. |
| --- | --- | --- |

[](https://help.qlik.com/en-US/qlikview-developer/Subsystems/QMSAPIref/Content/PIX.Services.V12.Api8.IQMS8.SaveCALConfiguration.htm) [](https://help.qlik.com/en-US/qlikview-developer/Subsystems/QMSAPIref/Content/PIX.Services.V12.Api8.IQMS8.SaveCALConfiguration.htm)

## SaveCALConfiguration(CALConfiguration)

Saves the CAL configuration.

### Declaration

```

          void SaveCALConfiguration(CALConfiguration calConfiguration)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [CALConfiguration](https://help.qlik.com/en-US/qlikview-developer/May2024/Subsystems/QMSAPIref/Content/PIX.QMSAPI.DataObjects.CALs.CALConfiguration.htm) | calConfiguration | 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

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.

```
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();
    }
}
```