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, ...
Unanswered

Open LedgerJournalTransDaily form from a Custom form on Button Click

(1) ShareShare
ReportReport
Posted on by 16
Hi, I have below code written to open LedgerJournalTransDaily form from a Custom form on Button Click.

Custom table is ImpInboundData and it has a field JournalNum. On click of button "Open General Journal Lines", I want to open LedgerJournalTransDaily form based on JournalNum available in Custom table.
 
Intention is to Open the LedgerJournalTransDaily form directly from Custom Form to Validate journal lines and to proceed with Posting.
 
Below is the code on click of Button
public void clicked()
{
   Args args;
   LedgerJournalTable ledgerJournalTable;
   ImpInboundData impInboundData;
   LedgerJounralId ledgerJournalId;
	
   impInboundData = impInboundData_ds.cursor();
   ledgerJournalTable = LedgerJournalTable::find(impInboundData.JournalNum);
	
   if(ledgerJournalTable.RecId)
    {
	   args = new Args();
	   args.name(formStr(LedgerJournalTransDaily));
	   args.record(ledgerJournalTable);
	   new MenuFunction(menuItemDisplayStr(LedgerJournalTransDaily),MenuItemType::Display).run(args);
	}
	else
	{
	   warning("Journal Not Found");
	}
}
I am getting "Object Reference not set to an instance of an object. JournalFormTable was null" error in formInitPost method of LedgerJournalTransDaily form. This is when .run(args) is triggered. How can this be resolved.

Attached error screenshot.
 
Error.png
Categories:
I have the same question (0)
  • Subra Profile Picture
    20 on at
    I hope ledgerformtable buffer has been no filled, could you please get the value from the calling form (Args).

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 658

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 315 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans