QueryBuildDataSource

Hi,

where can I find information about QueryBuildDataSource methods.
I’m interested in exaples, explanation what do those methods.

Where i can find it??

The class and its methods are documented here: QueryBuildDataSource on MSDN. You can find many examples in standard AX - use cross references for finding them.

this is a lookup with QueryBuildDataSource .Lookup at this maybe its help you.

public void lookup()

{

Query query = new Query();

QueryBuildDataSource qbds;

QueryBuildDataSource QbdsJoin;

// Instantiate sysTableLookup object using table which will provide the visible fields

SysTableLookup sysTableLookup = sysTableLookup::newParameters(tableNum(TableName), this);

;

// Create the query.

qbds= query.addDataSource(tableNum(TableName));

qbds.addRange(fieldNum(TableName, FieldName)).value(‘Value’);

//Join Table

QbdsJoin= qbds.addDataSource(tableNum(TableName2));

QbdsJoin.relations(true);

QbdsJoin.joinMode(JoinMode::ExistsJoin);

QbdsJoin.addRange(fieldNum(TableName2, Fieldname)).value(‘Value’);

// Set the query to be used by the lookup form

sysTableLookup.parmQuery(query);

// Specify the fields to show in the form.

sysTableLookup.addLookupfield(fieldNum(TableName, FiledName));

sysTableLookup.addLookupfield(fieldId2Ext(fieldNum(TableName, Dimension), 1));

// Perform the lookup

sysTableLookup.performFormLookup();

}