web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Capture Company Range Parameter

(0) ShareShare
ReportReport
Posted on by 110

Hello,

I would like to capture in my X++ code the selected companies circled in red.

These checkbox are located in the select criteria button pointed in green.

PS: This is a modified VendAccountStatementInt report to read data from multiple companies.

Thank you for your help.

Regards.

Capture-companies.PNG

*This post is locked for comments

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    299,361 Super User 2025 Season 2 on at
    RE: Capture Company Range Parameter

    Hi White,

    I don't know if you have found your answer already, but the Query class object contains a method called 'getCompanyRange'. The result is a container with companies.

  • Rabih Khoury Profile Picture
    110 on at
    RE: Capture Company Range Parameter

    Merci André,

    What I really want is to filter this query by the selected parameters in company range.

    If I get the result by a container how can i integrate it in the query?

    Thanks.

    company-filter.PNG

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at
    RE: Capture Company Range Parameter

    Hi,

    If you have the companies in a container then you can use the below kind of query/code to apply company range.

        VendTrans custVendTrans;
        container legalEntites = ["addt" , "adt2", "dat"];
     
        select crossCompany:legalEntites sum(AmountMST) from custVendTrans
            where custVendTrans.AccountNum == this.AccountNum
            && custVendTrans.TransDate >= _fromDate
            && custVendTrans.TransDate == _toDate;
        
        info(strFmt("%1", custVendTrans.AmountMST));

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans