Service function with default parameter value

Hi,

I have defined service function in the service contract like this:

function getOrder(launcher: string; taskcount: Integer = 2000): TJSONArray;
with taskcount default value 2000

When I call the function only with first param like this
Response := Await(dmDataModule.xdtwbclntClientXData.RawInvokeAsync('IWEBService.getOrder', ['test1']));

I get an error "Missing value for parameter taskcount"
Why ?
The taskcount parameter has default value 2000.

You have to explicitly tell XData that the field has a default value, as stated in documentation:

https://doc.tmssoftware.com/biz/xdata/guide/service.html#default-parameters

1 Like

Ok thx ... good to know :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.