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 :
Microsoft Dynamics AX (Archived)

Journal Voucher Lines

(0) ShareShare
ReportReport
Posted on by 85

AX-Query.JPG

Please check the attached image file for my query.

I should hide a Grid column in Child Form(Journal Voucher) based on the value selected in Parent Form(General Journal).

[If i select the Journal Name as "Daily" and go to "Lines" then the customized field "Ref Project No." in Lines Grid should be visible, else it should not be visible.]

I am a bit new to AC development, so unable to figure out the best approach to meet this requirement.

Please help me on this. Please let me know if the requirement is not clear. Thank you in advance. 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    5400 Profile Picture
    7,162 on at

    yes you can achieve through code. You can write a in init method for this purpose. Note required to write code in active method.

    you will get  elemen.args.record() or from relation you will get journalNum in ledger  journal trans

    if (ledgerjournalName::find(ledgerJournalTable::find(ledgerjournaltrans.JournalNum).JournalName).JournalType == LedgerJournalType::Daily)

    {

      control.visible(true)

    }

    else

    {

     control.visible(true)

    }

  • 5400 Profile Picture
    7,162 on at

    You have to write same code in active method also bec you can delete all  delete the records from line(child) also.

  • 5400 Profile Picture
    7,162 on at

    \Forms\LedgerJournalTransDaily\Data Sources\LedgerJournalTrans\Methods\active

    if (ledgerjournalName::find(ledgerJournalTable.JournalName).JournalType == LedgerJournalType::Daily)

    {

     control.visible(true)

    }

    else

    {

    control.visible(false)

    }

    It should work for you.

  • 5400 Profile Picture
    7,162 on at

    Please create  one common method instead of writing same code two place passing jpurnalnum as argument for good practice.

    If you need init code. It is as below.

    \Forms\LedgerJournalTransDaily\Methods\init

    if (ledgerjournalName::find(ledgerJournalTable::find(journalNum).JournalName).JournalType == LedgerJournalType::Daily)

    {

    control.visible(true)

    }

    else

    {

    control.visible(false)

    }

  • Verified answer
    Hariharans87 Profile Picture
    36 on at

    1. Set grid column control (RefProjectNo) AutoDeclartion property to Yes.

    2. Instead of using active method, you can choose form init method and check your condition and visible/invisible the control.

  • Naveen5551 Profile Picture
    85 on at

    Thank you Mr. Bhaskar. It worked for me.

    I have written the logic in init method of Child Form.

    And, I could not find the active method in your specified path.

    "\Forms\LedgerJournalTransDaily\Data Sources\LedgerJournalTrans\Methods\active"

  • 5400 Profile Picture
    7,162 on at

    If you worked for you please mark verified for others.

  • Naveen5551 Profile Picture
    85 on at

    3617.AX-Query.JPG

    Dear All, I have another query on this.
    Now this "Ref Project No." should also be shown in the Voucher Transactions List (Form: LedgerTransVoucher), based on the Journal Number.
    So for this, I need to add new DS for table LedgerJournalTrans to get "Ref Project No." from it?
    The grid in LedgerTransVoucher is using the table GeneralJournalEntry. How do I link the tables? What should be done in this scenario? Thank you in advance.!

  • Naveen5551 Profile Picture
    85 on at

    Or I should write a query to get the value from LedgerJournalTrans table and fill the field in LedgerTransVoucher in init() ? If this should be done, how I can proceed for it?

  • 5400 Profile Picture
    7,162 on at

    Please can you raise different request for same. It will good for others also.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans