In order to allow me to focus on Consulting (click here) and Courses (click here), I continue to review all posts here in the Forums, but, in general, I'm only personally responding to posts that I mark as #AcumaticaTnT (click here). For Questions (click here), others may respond, or you can post over at Community.Acumatica.com (click here).
#AcumaticaTnT Automatic Task Creation with Business Event and Import Scenario
It occurred to me that you could use the Business Events feature in Acumatica to feed an Import Scenario that creates a Task and assigns it to a user.
I think there are a lot of potential applications of this.
Just jotting down some quick notes here so I remember how this was done. Thanks to Rodrigo Iglesias and Aleksey Safaralikhonov for helping me with the Import Scenario which was totally above my head.
Business Scenario: First, let's discuss the simple business scenario that I came up with. Basically, I wanted to automatically create a Task and assign it to a user whenever a Sales Order is placed On Hold.
First, you have a create a Generic Inquiry using the Generic Inquiry (SM208000) screen that has the data you need to generate an alert. Here is the Generic Inquiry that I created. Note that I hardcoded 'Sales Order' because I'm lazy, but you would need to make this a Switch statement in the real world to translate the Order Type code from "SO" to "Sales Order" or whatever Order Types you are using:
Second, you need to create an alert using the Business Events (SM302050) screen that will trigger when something happens with the data in the underlying Generic Inquiry. You can see that I setup my alert to trigger when the Status of a Sales Order is changed to On Hold:
Third, on the SUBSCRIBERS tab you need to create a new Import Scenario subscriber. You can see that I already created one below with the same name as the Business Event itself. Don't be confused though, the Event ID and the Subscriber ID fields are two completely different things. I just named them the same to confuse you 🙂
Fourth, here is where the "secret sauce" lies, the definition of the Import Scenario. Note a few things about it. First, the Screen Name is not Tasks, but Task and it's located at Hidden -> Task on the Site Map. Second, the Provider is the Business Event, not your typical data source like an Excel file. Third, the fields in Red have to be typed in manually because they are not available in the drop-down. This is where Rodrigo and Aleksey helped me a lot. Fourth, make sure you pay attention to all five columns (Active, Target Object, Field / Action Name, Commit, and Source Field / Value) and ensure that you set them all accordingly. Fifth, don't be too concerned by the scary looking "SOOrder_Formulab28f21c1ddd740ca9ddd0c1b73b063db" value. Note in the second screenshot below that I chose the familiar MyType column from the drop-down and Acumatica chose for some reason to display that scary looking value.
Fifth, before I show you the end result, I should probably show you what the actual data looks like in the Generic Inquiry. Here is what the Generic Inquiry looks like before I put my Sales Order on hold:
Sixth, I put the Sales Order on hold. This is what the Generic Inquiry looks like after I put my Sales Order on hold:
Seventh, because my Business Event was setup to pass the results of a Generic Inquiry change off to my Import Scenario, within seconds of me putting the Sales Order on hold, you can see a Task got automatically created on the Tasks (EP404000) screen. Note that we setup the Import Scenario "secret sauce" to connect the Task to the Sales Order so you can click on the link to the Sales Order from the Task in the screenshot below. When you're done reviewing it, you can click the COMPLETE button to mark the Task as completed.
I added an idea that you can vote on for making this easier. Basically, the idea is to add a Create Task subscriber to the existing list of subscribers on the Business Events (CS204000) screen.
Nice use case Kevin!
This is amazing! I know I'm going to use this for some of the automations I'm hoping Acumatica lets us do. This sounds like the path I need to go down for some of them. Thanks!
I am wanting to import about 16,000 debtor notes from a legacy system as Activities. The import scenario above for Tasks has me on the right track (I hope) but the syntax must not be quite correct. The scenario runs and I get a green tick, but no activity is created. the scenario looks like this (very simple) - I took an educated guess at the syntax from the Event example above.
As you can see, the process outlined above is really clunky. I haven't tried it for anything outside of Sales Orders, but I assume that there are land mines to be found.
I thought I'd point out a new feature in Acumatica 2021 R2 which makes the clunky process above obsolete.
You can read about this new feature on page 284 of the Acumatica 2021 R2 Release Notes. Here is a screenshot: