Solved

GI to identify duplicate customer order number and trigger business event

  • 6 December 2023
  • 11 replies
  • 150 views

Userlevel 5
Badge +1

Does anyone know if it is possible to create a scenario whereby a notification email is sent if an order with a duplicate CustomerOrderNbr is created?

I thought perhaps I could create a GI with aggregated results - grouped by the CustomerOrderNbr field - with an OrderNbr count, but according to this article GIs with Grouping are not supported by Business Events: 

 

Anyone know of a different approach that would solve this?

icon

Best answer by bryanb39 17 January 2024, 19:32

View original

11 replies

Userlevel 4
Badge

Hi Mike,

Have you tried conditioning the GI so that it only shows orders which have a duplicate value?

Then the BE might work better to trigger only off Record Inserted instead of multiple conditions.

Userlevel 5
Badge +1

Hi @MinushaWeerasuriya76 - Do you have any suggestions how to condition a GI to only show orders which have duplicate values in the CustomerOrderNbr field?

Userlevel 4
Badge

Hi @mikeho,

Will you be able to provide the XML of the GI so that I can have a look?

Userlevel 5
Badge +1

Hi @MinushaWeerasuriya76 - attached is a copy of the GI in question.

NOTE: In this case I’m checking the CustomerRefNbr field for duplicates.

 

Userlevel 7
Badge +12

hI @mikeho 

Do you want to stop duplicate order with same customer reference or you need just an email.

If you are looking for avoid order with duplicate customer order nbr please set below preference 

 

Userlevel 5
Badge +1

Hi @manikantad18 - an email would be preferable, but it’s good to know that there is the option to prevent duplicate customer order numbers at the order type level.

Userlevel 7
Badge +12

Hi @mikeho 

Seems to it is critical to anaylse the duplicate customer order nbr and trigger an Business events, Use standard functionality or else we need to see other suggestions as well.

Thanks

Userlevel 7
Badge

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

Userlevel 5
Badge +1

@Chris Hackett - Unfortunately, no, still trying to find a solve for this.

Userlevel 6
Badge +5

Try this:

Self join SO.SOOrder

CustomerID = CustomerID
CustomerOrderNbr = CustomerOrderNbr
OrderType = OrderType
OrderNbr <> OrderNbr

You may need to tweak it a bit if Order Type doesn’t always match, but you also don’t want to include CMs or RCs.  

This would only return orders that are duplicates with no grouping or aggregation needed. 

To do a self join, add the table again, you can give it an alias, I just called it SOOrder2 in this case.  

 

Userlevel 5
Badge +1

Thank you, @bryanb39! That’s such a simple solution but it works beautifully. I can even add a relation like “SOOrder.orderNbr -- Is Greater Than -- SOOrder2.orderNbr” to exclude the original (non-duplicate) order from the results.

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