SalesQuickQuote filtering

Hello Experts,

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

pastedimage1504203765176v1.png

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;

//LVL_145

//PriceDiscTable priceDiscTable;

QueryBuildDataSource qbd;

//End

if (inventTable_ds.queryRun())

{

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

}

else

{

query = inventTable_ds.query();

}

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

query.dataSourceTable(tableNum(InventDim)).indexIsHint(true);

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

query.dataSourceTable(tableNum(InventSum)).indexIsHint(true);

//mycode

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

qbd.clearlinks();

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

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

qbd.addLink(fieldNum(InventTable,ItemId),fieldNum(priceDiscTable,ItemRelation));

qbd.addRange(fieldNum(priceDiscTable,ItemRelation)).value(‘P0000605’);

//END

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);

inventAvailabilityFormCache.refreshCache();

super();

}

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.