Question

2021R1 BigCommerce Connector - How to re-sync orders that is already marked completed in Acumatica

  • 11 November 2022
  • 10 replies
  • 142 views

Userlevel 4
Badge

Hi Team,

We have some business scenarios where we are syncing the orders from BigCommerce, processing that in Acumatica, and Order gets completed and the order status in Acumatica is marked as ‘Completed’.

Now on BigCommerce, the order gets modified and we have to resync the order to get those updates reflected in Acumatica, but during this scenario the connector is not picking up this particular order as this is already marked as completed withing Acumatica.

Can you please suggest the best possible way to achieve this, to re-sync the orders even though those marked completed in Acumatica, through manual or Real Time or through a scheduler sync. The particular build where we are trying to achieve this is 21.119.0030.

 

Thank you in Advance!

 


10 replies

Userlevel 7
Badge +3

Hi @vivekm, we got your SR recently about this problem. We will be working to fix it…

However, for now the best way will be to customize it. Here is one of the examples - 

 

Userlevel 4
Badge

Thank you @smarenich for the details, will verify with the suggested approach and reach back if any additional help required.

Userlevel 4
Badge

Hi @smarenich I have verified with the suggested approach but it is not working. Please find below details that I have tried with, please review and suggest the next steps:

  • Order gets synced from BigCommerce to Acumatica with Invoice order template and processed till Invoice, and order status gets updated to Completed.
  • I tried below code (as suggested) to re-sync the same order but with this the above order does not gets picked up.

[PXOverride]
        public FilterResult FilterImport(IMappedEntity record, Func<IMappedEntity, FilterResult> baseHandler)
        {
            FilterResult result = baseHandler(record);

            if (record?.Local?.SyncID != null)
            {
                SOOrder soOrder = PXSelect<SOOrder, Where<SOOrder.noteID, Equal<Required<SOOrder.noteID>>>>.Select(Base, record?.Local?.SyncID);
                if (soOrder != null && soOrder.Status == SOOrderStatus.Completed)
                    return new FilterResult(FilterStatus.None);
            }

            return result;
        }

 

  • I also tried below code as well to re-sync the order but with this also the order does not gets picked up.

public delegate FilterResult FilterImportRestrictorsDelegate(IMappedEntity record);
        [PXOverride]
        public FilterResult FilterImportRestrictors(IMappedEntity record, FilterImportRestrictorsDelegate baseMethod)
        {
            FilterResult result = baseMethod(record);
            MappedOrder order = record as MappedOrder;

            if (order != null && order.IsNew && order.Extern != null)
            {
                if (order.Extern.StatusId == OrderStatuses.Shipped.GetHashCode() || order.Extern.StatusId == OrderStatuses.Completed.GetHashCode())
                {
                    return new FilterResult(FilterStatus.None,
                      PXMessages.LocalizeFormatNoPrefixNLA(BCMessages.LogOrderSkippedExtStatusNotSupported, order.Extern.Id, order.Extern.Status.ToString()));
                }
            }

            return result;
        }

 

Userlevel 7
Badge +3

@vivekm I think I misunderstood you initially. Since the Order is Completed in Acumatica, it cannot be modified. You see that all the fields are disabled. So the connector cannot modify it too. 

How that happened that Completed order is modified?

Userlevel 4
Badge

Hi @smarenich here is some background on this requirement:

  • Client is using a third party app (Randem) on BigCommerce to fulfill their BigCommerce orders.
  • Using this app the order on BigCommerce gets updated to Shipped status, at this time we are bringing this order in Acumatica with Invoice order template and processing till Invoices, and as a result order status gets updated to completed within Acumatica.
  • After some time this app updates the order status to Completed in BigCommerce. Now the client wants to create a Note Activity to this order in Acumatica for tracking purposes (that this order is pick up etc.) and wants to update Order Description that indicates this Order gets Completed in BigCommerce.
  • At this point the core connector itself is not picking up this order in any of the methods, for example: MapBucketImport(), GetBucketForImport().
  • If we can get this completed order in above mentioned places, we can create the CRM activity, update the order description (using PXDatabase.Update<> operation, if not possible through objects) as required, and close the order process.
Userlevel 7
Badge +3

@vivekm 

  • At this point the core connector itself is not picking up this order in any of the methods, for example: MapBucketImport(), GetBucketForImport().

One of the ideas that I have here, is that BigCommerce Order date_modified is not updated, when you change Order status is changed. Could you please check it? Because if date_modified is updated connector should call GetBucketForImport. 

May be the option is to change something to trigger update for date_modified ?

Userlevel 4
Badge

Hi @smarenich I verified the suggested scenario and identified that when order is not completed in Acumatica, we are getting the order in respective sales order processor methods. But when it gets completed within Acumatica, we are not getting the order in processor methods.

Userlevel 7
Badge +3

@vivekm I’m really sorry, but if the date_modified is updated, I do not see any reason why GetBucketForImport is not called in 2021r1 version. May be there is something specific related to how this external application is working. 

We can look deeper, but in this case we need access to the application and review the date_modified field on client’s BigCommerce instance. 

Userlevel 4
Badge

Hi @smarenich shall we create a Developer support ticket and refer to this thread and arrange for access, so that you can assist, can you please suggest ?

Userlevel 7
Badge

Hi @vivekm were you able to find a solution? Thank you!

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