Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Ledger transaction history report with two design based on legal entity in ax 2012 r3

(0) ShareShare
ReportReport
Posted on by 6

hi all,

i have modified only DESIGN  in Vendor transaction history report for Japan legal entity.

reportjpy.jpg

i have modified code in Controller class to run both design.

Controller class - LedgerTransListAccountController

main method -

public static void main(Args _args)
{
    LedgerTransListAccountController controller = new LedgerTransListAccountController();

    
    boolean         isIsoJP = false;

    isIsoJP = SysCountryRegionCode::isLegalEntityInCountryRegion([#isoJP]);

    if(isIsoJP)
    {
        #define.ReportName('LedgerTransListAccount.Report_JPY')
    }
    else
    {
       #define.ReportName('LedgerTransListAccount.Report')
    }
    // end

    controller.parmReportName(#ReportName);
    controller.parmArgs(_args);
    controller.startOperation();
}

now i login in to JPY legal entity but it's always run the STANDARD report only.

When i commented the else part code from above, then it's execute my customized report design .

Kindly let me know what to change here.

please give me more shed on this.

thanks!

  • nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: Ledger transaction history report with two design based on legal entity in ax 2012 r3

    You wrote earlier: "isIsoJP values is coming true but it's not enter in if condition and came out of loop."

    Could you put a breakpoint on lines 27 and 31 in your previously shared code. Then debug it, and show us a screenshot where we can see which breakpoint was hit, AND the value of "isIsoJP" variable. Thanks!

  • @rp@n Profile Picture
    6 on at
    RE: Ledger transaction history report with two design based on legal entity in ax 2012 r3

    no it's coming true, now i moved the code to PrePromptModifyContact method but for other legal entities it's running the new design only not standard design

    /// 
    ///    Sets default parameter values before the user is prompted for input.
    /// 
    protected void prePromptModifyContract()
    {
        boolean         isIsoJP = false; 
        LedgerTransListAccountContract ledgerTransListAccountContract = this.parmReportContract().parmRdpContract() as LedgerTransListAccountContract;
    
        if (!ledgerTransListAccountContract.parmFromDate())
        {
            // Provide a default date because the last value is empty.
            ledgerTransListAccountContract.parmFromDate(FiscalCalendars::findFirstDayofYear(Ledger::fiscalCalendar(), systemDateGet()));
        }
    
        if (!ledgerTransListAccountContract.parmToDate())
        {
            // Provide a default date because the last value is empty.
            ledgerTransListAccountContract.parmToDate(FiscalCalendars::findLastDayofYear(Ledger::fiscalCalendar(), systemDateGet()));
        }
    
    
        
        isIsoJP = SysCountryRegionCode::isLegalEntityInCountryRegion([#isoJP]);
    
        if(isIsoJP == true)
        {
            #define.ReportName('LedgerTransListAccount.Report_JPY')
        }
        else
        {
           #define.ReportName('LedgerTransListAccount.Report')
        }
        // end
    }

  • Suggested answer
    Sukrut Parab Profile Picture
    71,682 Moderator on at
    RE: Ledger transaction history report with two design based on legal entity in ax 2012 r3

    Clearly you isIsoJp is not coming true that's the reason your design is not getting executed. Can you see why you are getting false over there .

  • @rp@n Profile Picture
    6 on at
    RE: Ledger transaction history report with two design based on legal entity in ax 2012 r3

    yes, i debugged it,

    public static void main(Args _args)
    {
        LedgerTransListAccountController controller = new LedgerTransListAccountController();
    
        boolean         isIsoJP = false;
    
        isIsoJP = SysCountryRegionCode::isLegalEntityInCountryRegion([#isoJP]);
    
        if(isIsoJP == true)
        {
            #define.ReportName('LedgerTransListAccount.Report_JPY')
        }
        else
        {
           #define.ReportName('LedgerTransListAccount.Report')
        }
        // end
    
        controller.parmReportName(#ReportName);
        controller.parmArgs(_args);
        controller.startOperation();
    }

    isIsoJP values is coming true but it's not enter in if condition and came out of loop.

  • nmaenpaa Profile Picture
    101,156 Moderator on at
    RE: Ledger transaction history report with two design based on legal entity in ax 2012 r3

    Did you debug it? If yes, what did you notice / learn? If you did not debug it, please debug it.

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... 293,207 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans