Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
VRyzhkov
Contributor
Contributor

Can't create a task for document in mounted folder via QMS API

Hello

I'm trying to automate QMC tasks management with Powershell, but struggling with mounted folders. I'm using this Poweshell API client , but i have the same issues working with C# SDK.

Here is the code sample: 

# Connect QlikView
$Connection= Connect-QlikView -Version IQMS2
# Get desired document
$document = (Get-QVUserDocuments -qvsID $qvsid -Connection $Connection | Where {$_.Name -eq "Test.qvw" -and $_.RelativePath -eq "Test" -and $_.FolderID -eq '95492e9e-6210-493e-b513-543133b82775' })[0]
# Create task object
$task=New-QVDocumentTask -Scope "General,Reload,Triggering"  -ID (New-Guid).Guid -QDSID $QDSID 
    -General @{TaskName="SourceDocuments/Test/Test.qvw"; Enabled=$true; TaskWizardTrack="None"} 
    -Document $document -Reload @{Mode='Full'; SectionAccessMode='UseQDSAccount'} 
    -Triggering (New-QVTaskTriggering -Executionattempts 1 -Executiontimeout 360 -Triggers @([QlikView_CLI.QMSAPI.ExternalEventTrigger]@{Enabled=$true; ID=(new-guid).Guid; Type='ExternalEventTrigger'; Password="" }) ) 
# Save task
Save-QVDocumentTask -Documenttask $task -Connection $Connection

It works great while .qwv`s are in C://Program Data/QlikTech/Documents , but behaves really strange with mounted folder.

In fact, it actually creates the task, but when i run it, the task always fails with the following reason

(8/26/2022 6:38:27 PM) Error: The task "SourceDocuments/Test/Test.qvw" failed. Exception: || QDSMain.Exceptions.TaskFailedException: Task execution failed with errors to follow. ---> QDSMain.Exceptions.SourceDocumentNotFoundException: Could not find SourceDocument (Distribution): qvp://rds1/Test/Test.qvw ||    at QDSMain.DistributeTask.PerformExecute(IExecutingTaskResult executingTaskResult) ||    --- End of inner exception stack trace --- ||    at QDSMain.DistributeTask.PerformExecute(IExecutingTaskResult executingTaskResult) ||    at QDSMain.Task.AbstractTask.TaskExecution(CurrentExecutionArgs args)

Tasks created from root folder have no such problems.

Maybe there is something  i'm missing?

Thank you!

Note: I do not have Publisher license on this server.

 

Labels (2)
0 Replies