2 Replies Latest reply: Jul 14, 2011 2:43 PM by Igor Alcantara RSS

    Create a Reload Task using QMS API

    Igor Alcantara

      I am using a QMS API and I want to create a reload task to a document. I do not have Publisher, so It is not a publisher task. What I want is programaticaly add a reload time to a document as we do in QlikView Server when we don't have Publisher installed.

       

      Please find below the function code that should do that. Right now It is just a piece of test to see if I can add a task to a document and save it.

       

      The SaveDocumentTaskFunction returns the following error. It is asking for the Guid of the DistributionService but, as I said, there is no Publisher installed.

       

      The error is Validation of DocumentTask object failed: QDSID property cannot be an empty Guid

       

      The code is:

       

      public void getQVDocument(string sDocument)

              {

                  DocumentNode oDoc;

                  DocumentTask oTask;

                  DocumentTask.TaskReload oReload;

       

       

                  try

                  {

                      oDoc = Document(sDocument);

                      //Client.GetTasksForDocument(oDoc.ID);

                      oTask = new DocumentTask();

                      oTask.Scope = DocumentTaskScope.Reload;

                      oTask.Document = oDoc;

                      oReload = new DocumentTask.TaskReload();

                      oReload.Mode = TaskReloadMode.Full;

       

       

                      oTask.Reload = oReload;

       

       

       

       

                      Client.SaveDocumentTask(oTask);

                      int icount = oDoc.TaskCount;

       

       

                  }

                  catch (Exception oEx)

                  {

       

                  }

       

       

              }