Skip to main content
Solved

22r2 BC Connector SaveBucketImport Override

  • 20 December 2022
  • 2 replies
  • 30 views

Not sure if I am missing something, but I have been having trouble overriding the SaveBucketImport method under 22r2 in the BC Connector.  The prior definitions did not include the optional parameter CancellationToken.

The new original signature  looks like :

public override async Task SaveBucketImport(BCSalesOrderBucket bucket, IMappedEntity existing, String operation, CancellationToken cancellationToken = default)

 

In my extension I have

 public delegate Task SaveBucketImportDelegate(BCSalesOrderBucket bucket, IMappedEntity existing, String operation, CancellationToken cancellationToken = default);

        ÂPXOverride]
        public virtual async Task SaveBucketImport(BCSalesOrderBucket bucket, IMappedEntity existing, String operation,  CancellationToken cancellationToken = default, SaveBucketImportDelegate baseMethod,)

 

When i compile, it is indicating that the Optional parameter (CancellationToken) must be after the Required parameter (SaveBucketImportDelegate) - if i switch them around I get a signatures do not match error.

Not really sure what the correct syntax would be. Or perhaps a new approach to overriding the behavior in 22r2.

Thanks!

 

2 replies

Userlevel 7
Badge +3

Hi @mgifford5 please try to remove default from the parameter

 public delegate Task SaveBucketImportDelegate(BCSalesOrderBucket bucket, IMappedEntity existing, String operation, CancellationToken cancellationToken);

I think it should work this way.

Userlevel 4
Badge

Hi @mgifford5 please try to remove default from the parameter

 public delegate Task SaveBucketImportDelegate(BCSalesOrderBucket bucket, IMappedEntity existing, String operation, CancellationToken cancellationToken);

I think it should work this way.

That makes sense and appears to be working - will post back if anything pops up - Thanks for fast reply!!

Reply