SalesQuickQuote filtering

Hello Experts,

I want to filter the add lines command button on the sales Table.


I want the SalesQuickQuote to show only those items related to that customer.

How can I achieve this customization?

You mean items already sold to that customer? If so,
Existing items tab shows the items that has the InventSum. You can follow the similar approach by joining the salesLine/CustInvoiceTrans (depending on your requirement) to InventTable and add a range on salesLine.CustAccount.

Hi Kranthi,

Here is what I tried so far,

In Inventtable > executeQuery method

void executeQuery()


Query query;


//PriceDiscTable priceDiscTable;

QueryBuildDataSource qbd;


if (inventTable_ds.queryRun())


query = inventTable_ds.queryRun().query();




query = inventTable_ds.query();


query.dataSourceTable(tableNum(InventDim)).addSortIndex(indexNum(InventDim, DimIdIdx));


query.dataSourceTable(tableNum(InventSum)).addSortIndex(indexNum(InventSum, ItemDimIdx));



qbd = query.dataSourceTable(tableNum(InventTable)).addDataSource(tableNum(PriceDiscTable));


qbd.joinMode(JoinMode::InnerJoin); // Indicate you don’t want to use relations automatically

qbd.relations(true); // Add link between parent field and child field




if (!queryFirst)


//in case visible inventory dimension fields have been changed reread inventDimParm and reset cache

inventDimParm = inventDimFormSetup.parmDimParmVisibleGrid().data();

inventSumQtyMap = new Map(Types::Container, Types::Container);




queryFirst = false;


I am able to filter my test record P0000605 but get this error

Any idea what am I doing wrong?

Why are you adding PriceDiscTable? Why inner join, shouldn’t it be exists join?

Hi Kranthi,
I need items of that customers who has active trade agreements. so that is the reason I am using price disc table
I will try using exists join and let you know how it goes.