Hi,
This issue was discussed in this topic here - “Created looped method in customization Project”
I describe what I am trying to achieve :
I need to define a code which will be always executed, without any user actions,
One important moment - is should work if Acumatica IIS process is running, so even if we have not authorized in Acumatica the code inside package that was imported to Acumatica customization must work. The logic is very simple - it will just generate files in specific directory all time.
It was advised to perform to following steps in order to achieve the required result
- Create a new processing screen
- Written a logic in processing screen graph
- schedule this screen for every 10/20/30 minutes
I need to clarify some moments
The first one : during creating new screen - is it enough to generate new one screen without adding anything here (fields, other elements) at stat step (I do not need to use anything from this entity, no new fields, I just need to create independent code as mentioned above). If it is enough - good
Second moment
I was provided by sample of code that I can modify
public class SOProcess : PXGraph<SOProcess> { public PXCancel<SOOrder> Cancel; public PXProcessing<SOOrder> KNSOProcessView; #region Constructor public SOProcess() { KNSOProcessView.SetProcessCaption("Process"); KNSOProcessView.SetProcessAllCaption("ProcessAll"); KNSOProcessView.SetProcessDelegate( delegate (List<SOOrder> list) { GetOpenSSaaSOrders(list); }); } #endregion public static void GetOpenSSaaSOrders(List<SOOrder> list) { SOProcess graph = PXGraph.CreateInstance<SOProcess>(); graph.AMISSaaSProcessOrders(list); } public virtual void AMISSaaSProcessOrders(List<SOOrder> list) { if (list.Count <= 0) return; foreach (SOOrder currentOrder in list) { SOOrderEntry SOOrderGraph = PXGraph.CreateInstance<SOOrderEntry>(); try { //Code here. PXProcessing<SOOrder>.SetInfo(list.IndexOf(currentOrder), "Records Processed Successfully"); } Catch(Exception Ex) { PXProcessing<SOOrder>.SetError(list.IndexOf(currentOrder), Ex.Message); throw new PXOperationCompletedWithErrorException(Ex.Message); } } } } }
The code that I was provided launches the new entity as I understand.
I do not know what should be used instead of soentry, soorder entities in my case. Because, I do not use Sales Order. All I need is to define independent code that will create files. How I should implement it for my screen ?