web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Creating a simple sysFramework batch with a query as parameters

(0) ShareShare
ReportReport
Posted on by 329

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? 

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    238,836 Most Valuable Professional on at

    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().

  • Superbunny Profile Picture
    329 on at

    Ah thanks! I indeed removed, seeing it was optional.

  • Martin Dráb Profile Picture
    238,836 Most Valuable Professional on at

    No, the framework doesn't assume any default method name. It must be specified in some way.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 470

#3
Adis Profile Picture

Adis 270 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans