Skip to main content
Solved

22r2 BC Connector SaveBucketImport Override


Mike Gifford
Jr Varsity III
Forum|alt.badge.img

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!

 

Best answer by smarenich

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.

View original
Did this topic help you find an answer to your question?

2 replies

smarenich
Acumatica Moderator
Forum|alt.badge.img+3
  • Acumatica Commerce Edition Team Lead
  • 227 replies
  • Answer
  • December 20, 2022

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.


Mike Gifford
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 25 replies
  • December 20, 2022
smarenich wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings