Hi,
you should firstly write the code in the form data source init method, instead
of writing it in the form's init method.
try this in your code, and remove the BankGuranateedetails with your
startupcommtable as and when required.
Query qry;
LedgerJournaltrans ledgerJournaltrans;
QueryBuilddataSource queryBuildDataSource;
QueryBuildRange qbdr;
;
super();
qry = new Query();
ledgerJournaltrans = element.args().record();
queryBuildDataSource = qry.addDataSource(tablenum(bankGuaranteeDetails));
qbdr =
queryBuildDataSource.addRange(fieldnum(bankGuaranteeDetails, NameOfparty));
qbdr.value(queryvalue(ledgerJournalTrans.AccountNum));
in this example, a bank guarantee settlement as and when is required to be done
from vendor payment journal, a form opens when button is clicked; this form is
having vendor code = selected vendor from ledgerjournaltrans.
--- On Thu, 6/26/08, sm_murugan <[EMAIL PROTECTED]> wrote:
From: sm_murugan <[EMAIL PROTECTED]>
Subject: [Axapta-Knowledge-Village] How to filter data source in the called
form having two data sources ?
To: Axapta-Knowledge-Village@yahoogroups.com
Date: Thursday, June 26, 2008, 12:55 PM
Hi,
I have a form with two grid controls each linked to two different
table. Both the tables having a field Quotation ID.
I want to call this form from Sales Quotation. When calling the form
the two grids should show only the data where QuotationId is equal to
calling Sales Quotation ID. If no records found the user will be able
to enter new records and the QuotationId field will be populated
automatically.
How can I filter the records in both the grids ?
I was trying the following code in form init()
startupCommTable_ ds.query( ).dataSourceTabl e(tablenum
(StartupCommTable) ).addRange( fieldnum( StartupCommTable ,
QuotationID) ).value(Qid) ;
OperationSpares_ ds.query( ).dataSourceTabl e(tablenum
(OperationSpares) ).addRange( OperationSpares, QuotationID) ).value(Qid) ;
//Qid is the Quotation Number.
It shows all the records in borth tables.
Can anyone help me what is the correct code and where it should be
written?
Thanks
Murugan