TXDataClientLoadProc "has wrong number of parameters"

I have the following method

procedure TCredentialService.CurrentUserAccess(const AUserId: Integer; AOnSuccess: TOnSuccessProcEx;
  AOnError: TOnErrorProc);
 Procedure OnSuccess(Response: TXDataClientResponse);
  Begin
    AOnSuccess(Response.Result);
  End;

  Procedure OnError(Error: TXDataClientError);
  Begin
    AOnError(Format('%s: %s', [Error.ErrorCode, Error.ErrorMessage]));
  End;
Begin
  FClient.RawInvoke('ICredentialsService.CurrentUserAccess', [AUserId], OnSuccess, OnError);
end;

But this won't compile. I get

Wrong number of parameters specified for call to "OnSuccess"

It looks ok and matches the TXDataClientLoadProc definition in XData.Web.Client.

I haven't had issues in others apps, although this is the first one in 1.5.

Any ideas?

This is the correct way to use it:

  FClient.RawInvoke('ICredentialsService.CurrentUserAccess', [AUserId], @OnSuccess, @OnError);

thanks. sometimes you can't see the wood for the trees

1 Like

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