Skip to main content Skip to complementary content

ImportDocumentTask Method

Overloads

ImportDocumentTask(Guid, Guid, Guid, DocumentNode)

Imports a single document task from a remote QlikView Distribution Server.

ImportDocumentTask(Guid, Guid, Guid, DocumentNode)

Imports a single document task from a remote QlikView Distribution Server.

Declaration

      void ImportDocumentTask(Guid remoteQmsId, Guid remoteDocumentTaskId, Guid destinationQdsId, DocumentNode destinationDocument)
    

Parameters

Type Name Description
System.Guid remoteQmsId

The ID of the remote QMS.

System.Guid remoteDocumentTaskId

The ID of the remote task to be imported.

System.Guid destinationQdsId

The ID of the QDS to which the task is to be imported.

DocumentNode destinationDocument

The document to import the task to.

Remarks

Only source document folders that the caller have access to will be returned.

security

Requires membership of local group QlikView Management API and the role Document Folder Administrator.

Examples

In the example below, a list of tasks is retrieved for a known source document on a remote QlikView Management Service. Each task is imported to a document on the "local" QMS.

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

            //Find a the remote QMS service.
            ServiceInfo remoteQMSService = apiClient.GetServices(ServiceTypes.RemoteQlikViewManagementService).FirstOrDefault();

            //Find a local QDS service
            ServiceInfo localQDS = apiClient.GetServices(ServiceTypes.QlikViewDistributionService).FirstOrDefault();

            //Get the tasks of a remote document.
            Guid remoteDocId = new Guid ("12a32214-1122-112a-8099-8765ce564112"); // The remote document ID.
            List<TaskInfo> taskInfos = apiClient.RemoteGetTaskListForDocID(remoteQMSService.ID, remoteDocId);

            //Get a local document.
            Guid localDocId = new Guid("c7c66836-f00b-47c4-8099-23ff7f178423"); // The local document ID.
            DocumentNode destinationDocument = apiClient.GetSourceDocuments(localQDS.ID).Where(dn => dn.ID == localDocId).FirstOrDefault();

            if (destinationDocument != null)
            {
                //Apply each remote task on the local document.
                foreach(TaskInfo taskInfo in taskInfos) {
                    apiClient.ImportDocumentTask(remoteQMSService.ID, taskInfo.ID, localQDS.ID, destinationDocument);
                }
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("An exception occurred: " + ex.Message);
        }
        // wait for user to press any key
        Console.ReadLine();
    }
}
  

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!

Join the Analytics Modernization Program

Remove banner from view

Modernize without compromising your valuable QlikView apps with the Analytics Modernization Program. Click here for more information or reach out: ampquestions@qlik.com