# One dialog value depend for next dialog lookup

**URL:** <https://www.dynamicsuser.net/t/one-dialog-value-depend-for-next-dialog-lookup/52395>\
**Category:** Developer Forum\
**Created:** [April 28, 2014, 7:50am UTC](https://www.dynamicsuser.net/t/one-dialog-value-depend-for-next-dialog-lookup/52395 "2014-04-28T07:50:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Palanivel](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@Palanivel](https://www.dynamicsuser.net/u/Palanivel)\
**Post date:** [April 28, 2014, 7:50am UTC](https://www.dynamicsuser.net/t/one-dialog-value-depend-for-next-dialog-lookup/52395/1 "2014-04-28T07:50:11Z")

</div>

Dear Fnds,

I have customized customer releated report , in that i have done two dialog fields,1.cust group and 2.custa account

in first we are choosing AP-DD means second dialog has to lookup only that custgroup but not happening this that , So some one help me. for your reference i have given the my codings also , where i did mistake plz help me.

public class ReportRun extends Runbase

{

DialogField TestDialogFields,emplIdField,dialogByDate,dialogToDate,dialoginvoice,myPackingSlipIdField,myLineOfPackingSlipIdField;//,dialogstate,dialogAccountNUm;

fromDate byDate;

fromdate toDate;

packingslipid myPackingSlipId;

tempinv tempinv;

DialogField dialogcustGroup,dialogcustaccount ;

CustTable obj\_CustTable,obj\_dev\_CustTable ;

custaccount CID;

//CustInvoiceId id;

DialogField dialogCreateServiceOrders;

NoYesId createServiceOrders;

CustAccount custAccount,v;

custgroupid custidg;

//ueryRun queryRun;

#define.CurrentVersion(1)

#define.version(1)

#localmacro.CurrentList

createServiceOrders

#endmacro

//variable

int sno,pge;

real unitprc,linamt,invamt,linedis;

itemid invitem;

inventbatchid getInventBatchId;

inventqty qty;

CustInvoiceId invid,oldinvid;//,id;

invoicedate invoicedt;

SalesEndDiscPct TotDisper;

SalesSumLineDiscAmount disc;

SalesSumLineDiscAmountMST disprc;

transdate lrdt;

lrno lrno;

Transporter trp;

VehicleNo vno;

//Tabele

CustInvoiceJour custinvoicejour,jour;

CustInvoiceTrans custinvoicetrans,trans;

InventReportDimHistory inventreportdimhistory,dimhis;

Inventdim inventdim;

real cqty,invqty;

salesId salesId;

//MarkupQty oqty;

boolean isSummaryUpdated;

str lineHeaderPrinted[];

int lineHeaderPrintedCount;

container inventDimSetup;

InventDimCtrl\_Rep\_Sales inventDimReport;

str inventDimString;

boolean paymentSchedule;

boolean printDocuHeader;

boolean printInventDim;

PaymentStub giroType;

PrintCopyOriginal printCopyOriginal;

ReportSection giroSection;

FirstLast totalsFirstLastPage;

boolean taxPrintTaxFreeBalance;

boolean showFooter;

boolean showFooterPayment;

boolean showFooterEuro;

boolean showFooterPrepaid;

boolean showFooterPrepaidEuro;

boolean showFooterGiro;

boolean showFooterLocalCurAmt;

CustFormletterParameters custFormletterParameters;

CustFormletterDocument custFormletterDocument;

CustParameters custParameters;

CompanyInfo companyInfo;

Map sectionEnabledMap;

PaymMoneyTransferSlip\_BE moneyTransferSlip\_BE;

PaymMoneyTransferSlip\_CH moneyTransferSlip;

ReportStringControl paymentReference;

//Italian feature

boolean goodsDiscount;

DiscPct LineDiscount;

ReportTextControl reportTextControl;

PaymMoneyTransferSlip\_FI moneyTransferSlip\_FI;

container taxCodesUsed;

TaxTexts\_FI taxText;

MarkupTrans markupTrans;

MarkupTmpTrans\_FI tmpMarkupTrans;

TaxCode taxCode;

TaxGroup TaxGroup;

boolean custCreditInvoicing;

CustVendCorrectedInvoiceId correctedInvoiceId;

CustVendCorrectiveReason correctiveReason\_header;

CustVendCorrectiveReason correctiveReason\_lines;

AmountMST originalInvoiceAmount;

AmountMST originalInvoiceVATAmount;

boolean cashDiscOnInvoice;

DiscPct cashDiscPercent;

CashDiscAmount cashDiscAmount;

CashDiscAmount cashDiscAmountTax;

Amount amount;

Amount GrossInvAmount;

boolean isTaxInvoice;

ItemType taxInvoiceItemType;

AmountCur totalSalesBalance;

AmountCur totalDiscount;

AmountCur totalMiscCharges;

AmountCur totalSalesTax;

AmountCur totalRoundOff;

LedgerJournalTrans ledgerJournalTrans;

TaxUnrealizedPayment taxUnrealizedPayment;

//

RefRecId invoiceCount;

SalesLine salesLineRegNumbers;

int a;

str lic;

//

//Tables

InventTrans inventTransLoc,inventTransCheck;

Address address,partyAddress;

InventSite inventSite;

// InventLocation inventLocation;

DirPartyTable dirPartyTable,custPartyTable;

//InventDim InventDim;

//EDT’s

ItemId getItemId;

//InventBatchId getInventBatchId;

TransDate getBatchExpiryDate;

Qty salesInvoiceQty;

Amount salesPrice,SalesNetAmount;

Description itemDescription,cropDescription;

Qty packingUnitQty;

ItemId gloItemId;

//Integer sNo;

#Define.endDisc(‘CustInvoiceJour\_EndDisc’)

#Define.sumMarkUp(‘CustInvoiceJour\_SumMarkUp’)

#Define.sumTax(‘CustInvoiceJour\_SumTax’)

#Define.invoiceRoundOff(‘CustInvoiceJour\_InvoiceRoundOff’)

#Define.invoiceAmount(‘CustInvoiceJour\_InvoiceAmount’)

#Define.currencyCode(‘CustInvoiceJour\_CurrencyCode’)

}

public void dialogPostRun(DialogRunbase \_dialog)

{

// super(\_dialog);

\_dialog.formRun().controlMethodOverload(true);

\_dialog.formRun().controlMethodOverloadObject(this);

}

public Object dialog(Object \_dialog)

{

DialogRunbase dialog = \_dialog;

DialogGroup toFromGroup;

Args \_args;

str accountnum,custGroup;

custtable custtable;

custGroupid id;

;

dialogcustGroup = dialog.addField(typeid(CustGroupId),CustGroup,“CustGroup”);

dialogcustGroup.value();

dialogcustaccount=dialog.addFieldValue(typeid(custaccount),custaccount,id);

dialogcustaccount.value();

return dialog;

}

public void Fld4\_1\_Lookup()

{

SysTableLookup sysTableLookup;

QueryBuildDataSource queryBuildDataSource;

QueryBuildRange queryBuildRange;

Query \_query;

FormStringControl \_control;

;

sysTableLookup = SysTableLookup::newParameters(tablenum(CustTable),dialogcustaccount.control());

sysTableLookup.addLookupfield(fieldnum(CustTable, AccountNum));

sysTableLookup.addLookupfield(fieldnum(CustTable, CustGroup));

\_query = new Query();

queryBuildDataSource = query.addDataSource(tablenum(CustTable));

queryBuildRange = queryBuildDataSource.addRange(fieldnum(CustTable, CustGroup));

queryBuildRange.value(dialogcustaccount.value());

sysTableLookup.parmQuery(query);

sysTableLookup.performFormLookup();

}

Thanks

palani
