Solved

How do I selectively ignore a business event depending on the existing value of a field?

  • 21 September 2023
  • 4 replies
  • 55 views

Userlevel 5
Badge +1

I set up a business event to trigger an email to the customer when the shipment status changes to confirmed.

So far so good and working correctly.  The next issue is we wanted to have it ignore the business event if the ship via is set to PICKUP or NOTSHIPPED.

I set up a custom field and added a field update action to change this to checked on confirming the shipment. This is then checked in the business event to see if it just got set to true.

Then I added a fieldverifying event to check the value in shipvia to determine whether to check this box.  This seems to have been working OK but some confirmed shipments seem to never trigger the email but I’m not sure why not. I’m presuming that sometimes the value of the checkbox is not set by the time the event kicks in to send the email. (Is that a possibility?)

 

I’m not sure if there is a better way to do this process.  There doesn’t seem to be an option to check the field value in the business event unless it just changed so if the shipment had been saved previously and the value didn’t just change when the shipment changed status to confirmed it doesn’t trigger.

What is the correct way to trigger an email for these conditions or should I be using some other method of triggering these emails?

Thanks for any advice,

Phil 

icon

Best answer by ppowell 21 September 2023, 18:34

View original

4 replies

Userlevel 7
Badge +12

I am presuming based on your comments you have the Business Event being triggered by the Action of Confirm on the Shipment. If so what i would do instead is create a Generic Inquiry that picks up the Shipments you want the business event to be triggered for so you can put the conditions in to check for Confirmed Shipment but the ShipVia is not Pickup etc.

When you have the GI working then set this to as the Screen Name on the Business Event and set the Type to Trigger by Record Change and then the condition is record inserted

So when a new Shipment is confirmed and it meets the condition then it wll appear on the GI Results which will trigger the busniess event

Userlevel 5
Badge +1

@dcomerford I tried that method and it works great but for one thing.  The other requirement is that we also need to attach the confirmation printout as a PDF to the email notification which is only available as far as I can see if we trigger it from the shipment screen.

Userlevel 5
Badge +1

After thinking about the requirements I realised the way to satisfy the requirements was to set up a business event on the tracking number changing.  Obviously to be at status shipment confirmed it has to have a tracking number assigned.  Unfortunately it’s not possible (as far as I can tell) to monitor the tracking number in the business event so I had to add a customization to toggle the Send Email Conf. custom field when the tracking number changes to anything except null. Then I can monitor that checkbox in the business event.  This also means that if the shipment needs to be corrected and the tracking number changes I can toggle the flag to unchecked prompting a new shipment confirmation when it is toggled back after a new tracking number is assigned. I also have a fieldverifying eventhandler that makes sure Ship Via isn’t NOTSHIPPED or PICKUP.

Thanks @dcomerford for your suggestion even though it doesn’t work in our case,

 

Phil

 

Userlevel 7
Badge +12

@ppowell Your solution makes sense but why dont you use the tracking number not being empty as the condition on the GI. Then on the business event have a trigger condition of Row Inserted and also Field Changed for the Tracking number. So then once a tracking number is on the shipment it will appear on the GI triggering the business event. If someone changes the tracking number it will also trigger

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