I am trying to create a sysFramework batch which creates a purchaseOrder based on a tender.
For this I am trying to add a query to my batch operation. I tried using KanbanPrinterBatch as an example, but I cannot choose any parameters.
My contract class:
[DataContractAttribute] class CreatePurchaseOrdersForTendersContract { str packedQuery; public Query getQuery() { return new Query(SysOperationHelper::base64Decode(packedQuery)); } [ DataMemberAttribute, AifQueryTypeAttribute('_packedQuery', queryStr(BWI_TenderPurchaseOrders)) ] public str parmPackedQuery(str _packedQuery = packedQuery) { packedQuery = _packedQuery; return packedQuery; } public void setQuery(Query _query) { packedQuery = SysOperationHelper::base64Encode(_query.pack()); } }
My controller:
class CreatePurchaseOrdersForTendersController extends SysOperationServiceController { public static void main(Args _args) { CreatePurchaseOrdersForTendersController::newStandard(_args).startOperation(); } public static SysOperationController newStandard(Args _args) { SysOperationController controller = new CreatePurchaseOrdersForTendersController(classStr(CreatePurchaseOrdersForTendersService)); controller.parmArgs(_args); controller.parmDialogCaption("Create purchase orders for tenders"); return controller; } }
My service class only contains a simple process() method at this moment. The problem however, when I click on my menu-item and the sidepanel of the batch opens, the header called 'Records to include' somehow does not render at all.
Question 1:
I assume I'm missing just one simple thing or so, but I am not getting any errors anywhere. Does anyone know what I am missing?
I read somewhere you can use initQuery to change the query setup and it then has to be called in the controller class. I can see that the Kanban contract class does have an initialize method, but I do not see that getting called.
Question 2:
If I wanted to make some changes to my query via an init method, am I supposed to call it then or how is this initialize method of the kanban contract called when I can't find any references?
No, the framework doesn't assume any default method name. It must be specified in some way.
Ah thanks! I indeed removed, seeing it was optional.
Your controller doesn't say anywhere that process() method should be used. You need to do it either in the constructor (I tend to override it and doing it there) or pass it through parmMethodName() in newStandard().
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,836
Most Valuable Professional
nmaenpaa
101,156