Search code examples
c#acumatica

Activity to Run on Demand or by Schedule in Acumatica


Because Acumatica does not (today) have a good way of handling inventory backorders when it comes to service orders, I need to create a reconciliation activity for our client's dispatchers and schedulers.

At issue is that the inventory is allocated not just by sales orders but also by service orders (ie service truck heads out for a call, and has to take certain inventory items with them to fix the problem.)

So, my process will need to run through all of the sales orders and all of the service orders, and determine what can be fulfilled and which cannot. Sales orders will get precedence, of course, since Acumatica is already tracking backorder states there. Service Orders are unique, tho, in that they cannot be scheduled with partial inventory. Meaning, I can ship part of a sales order, but I cannot do a service call if they can only put part of the items they need on the truck.

This will need to run on a schedule, as well as on demand.

There seems to be no existing GRAPH to logically associate this with, since Sales Orders and Service Orders do not typically share the same Business Logic Space.

So -- what is the best way to do this? This is mainly a reporting activity, but I will need to be able to adjust the backorder values of inventory when all finished.

My initial thought was to do this as a REST API solution, which makes running it on schedule easy -- but I'm not sure how to do that on demand then. (And I am concerned pulling all inventory in via REST will be slow)

Or is it better to put this in a DLL and extend the action on a form to allow it to be called from there, and then tie that into the scheduler?

Is there any example in the documentation that shows how to do a task like this? I searched for it, as well as checking the training modules, but didn't see anything that I could use.


Solution

  • The recommended approach is to create an Acumatica processing screen: https://www.acumatica.com/blog/creating-custom-processing-screens-in-acumatica/

    A processing screen is tied to a graph that use PXProcessing data view instead of PXSelect.

    They display an automation schedule dialog which can run the process automatically at a predefined interval without user intervention: enter image description here