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, ...
Suggested Answer

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

(0) ShareShare
ReportReport
Posted on by 30

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!

I have the same question (0)
  • nmaenpaa Profile Picture
    101,162 Moderator on at

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

  • @rp@n Profile Picture
    30 on at

    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.

  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    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
    30 on at

    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
    }

  • nmaenpaa Profile Picture
    101,162 Moderator on at

    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!

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 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans