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

The form datasource query object does not support changing its AllowCrossCompany property

(0) ShareShare
ReportReport
Posted on by 2,894

Hi, I'm working in AX 2012 R2, and I need to display records from different companies so I set the property on each datsource to allow crossCompany, however I'm getting the error as soon as the executeQuery gets is called:

The form datasource query object does not support changing its AllowCrossCompany property after the form has executed the query.

I would appreciate your help on fixing this issue. The records are retrieved fine but the error is showing up. Thanks.

*This post is locked for comments

I have the same question (0)
  • Ivan (Vanya) Kashperuk Profile Picture
    on at

    Check to see if you are also trying to update this property from code?

  • saman0suke Profile Picture
    2,894 on at

    Maybe someone else is doing it, I will take a look at it, what if that's not the case? Thanks!

    Regards.

  • saman0suke Profile Picture
    2,894 on at

    I just checked and no one else is trying to set that on code, what else should I check? thanks.

  • Pradeep Itnal Profile Picture
    3,248 on at

    Hi

    Have you modified the code in excuteQuery method? if so, can you put the code before super()?

  • Amir Nazim Profile Picture
    5,994 on at

    how u set the allowcrosscompany property . through code ?

  • saman0suke Profile Picture
    2,894 on at

    The code after super() does not make any reference to crossCompany, just regular code, and the property is being set on the datasource by using the property CrossCompanyAutoQuery. Thanks.

  • Suggested answer
    Jonathan  Halland Profile Picture
    11,310 on at

    Hi.

    Try set the "SetCompany" property on your form's design node to "No"

  • saman0suke Profile Picture
    2,894 on at

    Did not work, any other idea? thanks for the help.

  • Mic Kan Profile Picture
    on at

    You are right, I faced with this problem lastly and followed Your suggesion with overwrite DS executeQuery method:

    public void executeQuery()
    {;

    this.query().allowCrossCompany(true); //this is literal for this example, change in practice to sth more functionally
    //
    super();

    }

    You don't need change CrossCompanyAutoQuery properies at form at all.

  • Community Member Profile Picture
    on at

    Hi saman0suke,

    Please share the answer. i am also getting the same error but now on Dynamics 365.

    Please reply me at earliest.

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

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans