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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

SubledgerJournalTransferRequest object not initialised.

(0) ShareShare
ReportReport
Posted on by 185

I am working on a batch job having class SubledgerJournalTransferController which extends SysOperationServiceController. I follow the following article for guidance https://dynamicsaxinsight.wordpress.com/2015/04/24/ax-2012-customize-controller-for-batch-job/ . When I am opening the action menu item I am getting the following error

"SubledgerJournalTransferRequest object not initialised". 

Stack trace

(C)\Classes\SubledgerJournalTransferController\main - line 14

and this is my main method.

public static void main(Args args)
{
SubledgerJournalTransferController controller;
SubledgerJournalTransferRequest dataContract;
identifierName className;
identifierName methodName;
SysOperationExecutionMode executionMode;

[className, methodName, executionMode] = SysOperationServiceController::parseServiceInfo(args);
controller = new SubledgerJournalTransferController(className, methodName, executionMode);

// Initialize data contract and set default ledger to current
dataContract = controller.getDataContractObject(classStr(SubledgerJournalTransferRequest));
dataContract.parmledgerId(Ledger::current()); 

if (controller.prompt())
{
controller.run();
}
}

//Note: The line in red is 14th line.

Please guide.

I have the same question (0)
  • Blue Wang Profile Picture
    on at

    Hi Bilal,

    You can initialize the contract first in prePromptModifyContract().

    contract = this.parmReportContract().parmRdpContract() as SubledgerJournalTransferRequest;

    You use 

    dataContract.parmledgerId(Ledger::current()); 

    The error may be because it is null.

    In your DP class, whether to use SRSReportParameterAttribute to correctly point to your contract class(SubledgerJournalTransferRequest).

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans