Solved

22r2 BC Connector SaveBucketImport Override

  • 20 December 2022
  • 2 replies
  • 27 views

Userlevel 4
Badge

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!

 

icon

Best answer by smarenich 20 December 2022, 22:19

View original

2 replies

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!!

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.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved