Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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 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.error1.PNG

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:dis.PNG

1 Solution

Accepted Solutions
Not applicable
Author

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.

View solution in original post

2 Replies
Not applicable
Author

QUESTION CONTINUED


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 the TaskDistributionDestinationQlikViewServer objects ID or perhaps its other members.

//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;

Not applicable
Author

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.