Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

addRange with container field:

744 views
Skip to first unread message

Alex Colombini

unread,
Oct 11, 2007, 10:35:02 AM10/11/07
to
Hi to all,
it's possible create a query with a range on a container field?

I want to obtain the same result as this select:
select localSalesLine
where localSalesLine.Dimension[3] == "xyz";

My query is like this one:
q = new query();
qbds = q.addDataSource(tablenum(SalesLine));
qbds.addRange(fieldnum(SalesLine, Dimension)).value("xyz");
qr = new queryRun(q);

but in this case i can't filter the third dimension's field

Any idea?
Thanks to all....bye!
Alex

ryu

unread,
Oct 11, 2007, 11:30:01 AM10/11/07
to
hi alex,

you can use for container field :

declare queryBuildRange like "DimensionRange", then in your query use this:

dimensionRange =
this.query().dataSourceTable(TableNum(SalesLine)).addRange(FieldId2Ext(FieldNum(SalesLine, Dimension),3));

use 3 for the third field of dimension.

then affect a value :

dimensionRange.value("you value");

hope that will help you.

a+

Alex Colombini

unread,
Oct 12, 2007, 3:01:00 AM10/12/07
to
Thank you sooo much Ryu!
It's work perfectly!!!

Vanya Kashperuk Ivan at dot nospam

unread,
Oct 13, 2007, 5:42:01 PM10/13/07
to
Just a little correction for future notice.

Dimension type fields are not container, but array type field.
--
Kashperuk Ivan (Vanya), Dynamics AX MCBMSS
My blog - http://kashperuk.blogspot.com
MorphX IT in Russian - http://www.lulu.com/content/723888

Quay

unread,
Oct 27, 2007, 1:44:00 PM10/27/07
to
We have several companies running inside the same database. The dimensions
for all companies are shared ina virtual table so all companies now see all
the same dimension data. Is there a way to filter the data by company or
have the data codes include the company ID so that only selected dimensions
are visible in a single company?

Vanya Kashperuk Ivan at dot nospam

unread,
Oct 27, 2007, 2:06:00 PM10/27/07
to
Well, not really.
In the database, the dataAreaId field for each record in the Dimensions
table contains the value of the VirtualCompany ID, not the actualy companyId.
So in each of the companies there would be no way to tell, which company the
dimension really belongs to.

You would have to add another Company field to the Dimensions table, and
filter based on the curExt() on this column.
Or even add a separate table to set up the links of dimensions to companies.

But, honestly, I did not understand the problem. If you don't want companies
to see dimensions that don't belong to them, take the Dimensions table out of
the table collection, so that each company uses there own set of rows in this
table. Or is it not possible due to some other reasons?


--
Kashperuk Ivan (Vanya), Dynamics AX MCBMSS
My blog - http://kashperuk.blogspot.com
MorphX IT in Russian - http://www.lulu.com/content/723888

Quay

unread,
Oct 27, 2007, 8:56:00 PM10/27/07
to
It sounds simple like we need a company field in the virtual dimention table
to hold the AX company ID. I assume we could then filter on the lookup to
only show the company wher a user is currently logged in.

We have a total of 7 Dimensions. All are set up in a virtual table and
shared with all theother companies. That works great where we want all the
companies to share all the data in the dimention. For example we all use the
same universe of product codes. Sot that is desired that all the codes in
the dimension are shared.

Then we have other dimenstions like Job # and responsibility center
(functional groups) that are of a unique code structure and should only be
used by that local company. One company does not need to see all the jobs of
another company. We need to filter only those local jobs. Idealy it would
be great if that dimension were local rather than virtual.

We also have a second problem of bringing in transactional data from various
operational systems into each company. One of the dimensions is job# and we
need to have that job automatically inserted into the dimension so the full
transacitions can be imported. The issue is that the transaction cannot be
imported via the integration sofware and AIF becasue the job has not first
been populated into the dimension.

Thanks for your help

Quay

0 new messages