J. Schei
J. Schei

Reputation: 347

QlikView Management API erroring when including distribute

Hi I have created a task using the QMS API and have had success populating all general, reload, and reduce tabs but I am now having trouble when working with the distribute category. I'm trying to "Distribute to QlikView Server " and add a view users to distribute to. Except whenever I include distribute in the DocumentTaskScope (DocumentTaskScope.Distribute), the task seems to lose reference to the SourceDocument and the reduce category gets wiped, along with options from general and reload being lost. This is indicated by this dialog appearing when I click manage users when on the distribute tab. enter image description here

Also here is what my distribute panel actually looks like, as you can see it is missing the "Distribute to QlikView Server" area that should normally be there:

enter image description here

Here is my code for the distribute section, I am writing this program in c# and the program builds and executes with no errors, it just doesn't produce the intended result.

I was thinking if it had something to do with the server name syntax or if the ID member. The documentation indicated that this is meant to be the "The ID of the QlikView Server. ", so I used the id of the qlikview service but I am not certain this is what it is looking for.

//Distribute static ("Manually" in QV Management Console)

        DocumentTask.TaskDistribute.TaskDistributeStatic tds = new DocumentTask.TaskDistribute.TaskDistributeStatic();



        TaskDistributionDestination.TaskDistributionDestinationQlikViewServer tddqvs = new TaskDistributionDestination.TaskDistributionDestinationQlikViewServer();

        tddqvs.Name = "QVS@qlikviewdev";

        tddqvs.Mount = "Root Folder";

        tddqvs.ID = qvsGuid;



        TaskDistributionEntry newEntry = new TaskDistributionEntry();

        newEntry.Destination = new TaskDistributionDestination();

        TaskDistributionDestination tdd = new TaskDistributionDestination();

        TaskDistributionDestinationType tddt = new TaskDistributionDestinationType();

        tddt = TaskDistributionDestinationType.QlikViewServer;

        newEntry.Destination.Type = tddt;

        newEntry.Destination.QlikViewServer = tddqvs;

        TaskDistributionDestination.TaskDistributionDestinationFolder tddf = new TaskDistributionDestination.TaskDistributionDestinationFolder();

        tddf.Name = "N/A";

        newEntry.Destination.Folder = tddf;



        DirectoryServiceObject[] serviceObject = new DirectoryServiceObject[2];

        DirectoryServiceObject dso1 = new DirectoryServiceObject();

        DirectoryServiceObject dso2 = new DirectoryServiceObject();

        dso1.Name = "QlikView_Admin";

        dso1.Type = DirectoryServiceObjectType.Named;

        dso1.OtherProperty = "N/A";

        dso2.Name = "Qlikview_PowerUser";

        dso2.Type = DirectoryServiceObjectType.Named;

        dso2.OtherProperty = "N/A";

        serviceObject[0] = dso1;

        serviceObject[1] = dso2;

        newEntry.Recipients = serviceObject;



        TaskDistributionEntry[] tdeArray = new TaskDistributionEntry[1];

        tdeArray[0] = newEntry;





        tds.DistributionEntries = tdeArray;



        docTask.Distribute = new DocumentTask.TaskDistribute();

        docTask.Distribute.Static = tds;





        DocumentTask.TaskDistribute.TaskDistributeDynamic taskDistributeDynamic = new DocumentTask.TaskDistribute.TaskDistributeDynamic();



        taskDistributeDynamic.Destinations = new List<TaskDistributionDestination>().ToArray();

        taskDistributeDynamic.FieldName = string.Empty;

        taskDistributeDynamic.IdentityType = UserIdentityValueType.DisplayName;



        docTask.Distribute.Dynamic = taskDistributeDynamic;



        DocumentTask.TaskDistribute.TaskDistributeNotification tdn = new DocumentTask.TaskDistribute.TaskDistributeNotification();

        tdn.SendNotificationEmail = false;

        docTask.Distribute.Notification = tdn;



        DocumentTask.TaskDistribute.TaskDistributeOutput tdo = new DocumentTask.TaskDistribute.TaskDistributeOutput();

        tdo.Type = TaskDistributionOutputType.QlikViewDocument;



        docTask.Distribute.Output = tdo;

Upvotes: 0

Views: 273

Answers (1)

J. Schei
J. Schei

Reputation: 347

Turns out I was using the wrong GUID for the TaskDistributionDestinationQlikViewServer Objects' ID field. Once I set it to be the ID of the QVS@(servername) service, it worked.

Upvotes: 1

Related Questions