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.

  • Blue Wang Profile Picture
    on at
    RE: SubledgerJournalTransferRequest object not initialised.

    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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,907 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,777 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans