QlikTip #37: Retrieve all EDX tasks from QMSAPi

QlikView’s QMSAPI offers the method IQMS.FindEDX which returns all EDX tasks matching the given name.
If you have a look at the detailed explanation of this function it will return any EDX task containing the value for the given string:



So testing this in a real world scenario where you have the following EDX tasks:

EDX Task one
EDX Task two
EDx Task three

The function using the search key “X” will return just the following results:

EDX Task one
EDX Task two

So, yes, it is case sensitive and will only return the values containing exactly the key you were searching for.

So IQMS.FindEDX is:

  • Case sensitive
  • And it returns only task if “the name of an EDX taks contains this value” (the parameter)

But I had the requirement to retrieve ALL EDX tasks stored on QlikView Server, which can be accomplished by using the following method (C# code):

public static List<TaskInfo> GetAllEDXTaks(IQMS qmsApiClient)
{
List<TaskInfo> taskInfoList = new List<TaskInfo>();
IEnumerable<char> range = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!§$%&()=?*+#@'<>;:_-|1234567890".AsEnumerable();
char[] az = range.Select(i => (Char)i).ToArray();

foreach (var c in az)
{
    List<TaskInfo> taskResult = qmsApiClient.FindEDX(c.ToString());
    if (taskResult != null && taskResult.Count > 0)
    {
        foreach (TaskInfo r in taskResult)
        {
            if (taskInfoList.FindAll(e => e.ID == r.ID).Count <= 0)
            {
            taskInfoList.Add(r);
            }
        }
    }
}
return taskInfoList;
}
Bookmark and Share

and tagged . Bookmark the permalink. Both comments and trackbacks are currently closed.