Calling DataRetrieval getData with filters

In a C# class, I’m trying to call the getData method of DataRetrieval and am filling up DataRequestData with the necessary values. One requirement is to call getData with specific filters however, it looks like ParameterValues is read-only (and thus calling getData without ParameterValues will return all rows). How do you suggest I go about calling getData with filters ?

In addition to this, when getData is called with the SessionId from the /LogOn API call, I am getting exception message “The requested operation is not available to API accounts.”. Why isn’t getData allowed to (1) use the sessionId and (2) place filters on its calls?

Many thanks!

In order to assist with your inquiry, there are number of clarifications that are needed.

For instance an API account would not be able to make data retrieval calls.

Can you make use of a different account?

Please see article below for details.

https://www.dundas.com/support/learning/documentation/administration-configuration-customization/accounts#h3-add-a-new-account

Hope this helps.

Best regards

Hi Olukayode, yes it helped! I used a non-API account and was able to make a data retrieval call.

Its just the filtering of the results I need help with (ParameterValues). My objective is to call getData with filters thereby receiving a DataResultData object with the filtered results. From the documentation of DataRequestData, the filter texted are in the ParameterValues. However, ParameterValues are read-only. How can I programatically call DataRetrieval/getData with my filters in DataRequestData object?

Hello,

If you’re referring to the data contract class DataRequestData, the property IList<ParameterValueData> ParameterValues is not settable because it’s an enumerable. When you construct the class it will be created with an empty IList that you can add items to.

If you’re referring to IDataRetrievalService.RetrieveBusinessDataAsync then it takes an array of ClientRequest classes which takes an ICollection of parameters in the constructor.

Thanks.