Hi all,
I've made a testing form in AX2012 R2 CU6, containing a single datasource on PurchTable with the AllowCrossCompany property set to True.
I've added a grid, some fields and a button. All the other property values are left by default.
I've redefined the init() method on the datasource as follow:
public void init()
{
super();
this.query().addCompanyRange('A');
}
I've redefined the clicked() method button to print curext()
I'm opening the form from company B. It does show records of purchtable of company A which is correct to me. But the curext() returns 'A' when clicking on the button.
That suprises me because I would expect that AllowCrossCompany only affects the query, and not the context in which the X++ code is run.
So my question, do you think this is the expected behaviour? Should I open a case for this?
Thanks for your comments
Nicolas