Hi For BankAccountTrans there is a relation defualt dimension , now i am using a query names (CashBook)
and given relation as well , but dont know howto create lookup for business unit as well as i have to give range in this query for business unit as well . i already have created a dialog for bankaccount code , can i create lookup for business unit using these methods ..please help
query buildQuery() { QueryBuildDataSource qbdsBankAccountTable, qbdsBankAccountTrans; Query query = new Query(queryStr(CashBook)); qbdsBankAccountTable = query.dataSourceTable(tableNum(BankAccountTable)); qbdsBankAccountTrans = query.dataSourceTable(tableNum(BankAccountTrans)); qbdsBankaccountTrans.addRange(fieldNum(BankAccountTrans, TransDate)).value(queryRange(fromDate, toDate)); //Bank Code BankAcc = con2Str(BankAccCon); if(BankAcc) { BankAcc = strReplace(BankAcc,';',','); qbdsBankAccountTable.addRange(fieldNum(BankAccountTable, AccountID)).value(BankAcc); } return query; } public boolean getFromDialog() { boolean ret = super(); fromDate = dfFromDate.value(); toDate = dfToDate.value(); //Bank Account if (multiBankAccCtrl) { BankAccCon = multiBankAccCtrl.getSelectedFieldValues(); } return ret; } ////// dialog /// /// dialogLocal Object dialog() { #file DialogRunbase dialogLocal ; dialogLocal = super(); dfFromDate = dialogLocal.addFieldValue(extendedTypeStr(FromDate), fromDate,"@SYS5209"); dfToDate = dialogLocal.addFieldValue(extendedTypeStr(ToDate), toDate,"@SYS14656"); fbscMultiBankAcc = dialogLocal.curFormGroup().addControl(FormControlType::String, 'Bank Account'); fbscMultiBankAcc.label('Bank Account'); return dialogLocal; } ////// DialogPostRun /// /// Dialog public void dialogPostRun(DialogRunbase dialog) { FormRun formRun; super(dialog); formRun = dialog.dialogForm().formRun(); if (formRun) { //Bank Account fscMultiBankAcc = formRun.design().control(fbscMultiBankAcc.id()); multiBankAccCtrl = SysLookupMultiSelectCtrl::construct(formRun, fscMultiBankAcc, querystr(OABCashBookBankAcc)); } }
found that method in aot and it worked thankyou
If you want to add a lookup to the business unit - Adding View to the query is not enough. You need to create one more lookup method for business unit similar to bank account and call the lookup method in dialogPostRun method.
Thanks,
Girish S.
ok its just that i want to add lookup for business unit at dialog form.and i also added default dimenskon in my query
I am still not clear with your requirement. Sorry.
If you have any other requirements please elaborate more.
Thanks,
Girish S.
i dont have businessunitlookupname method in my class
On the dialogPostRun method you need to call the business unit lookup method.
businessUnitControl = _dialog.dialogForm().formRun().control(businessUnitControl.id()); businessUnitControl.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(ClassName, BusinessUnitLookupName), this);
Thanks,
Girish S.
busniess unit list is not coming here
Object dialog()
{
#file
DialogRunbase dialogLocal ;
dialogLocal = super();
dfFromDate = dialogLocal.addFieldValue(extendedTypeStr(FromDate), fromDate,"@SYS5209");
dfToDate = dialogLocal.addFieldValue(extendedTypeStr(ToDate), toDate,"@SYS14656");
dialogBusinessUnit = dialogLocal.addFieldValue(extendedTypeStr(Str1260), strBusinessUnit, "@OAR:OAR00179");
fbscMultiBankAcc = dialogLocal.curFormGroup().addControl(FormControlType::String, 'Bank Account');
fbscMultiBankAcc.label('Bank Account');
return dialogLocal;
}
If you want to lookup bank account only with default dimension business unit then you can add the DefaultdimensionView in the CashBook query itself. Add the Name as a range under range node and set the value to "BusinessUnit". It will look up only the bank account which is having business unit value.
Thanks,
Girish S.
query buildQuery()
{
QueryBuildDataSource qbdsBankAccountTable, qbdsBankAccountTrans;
Query query = new Query(queryStr(CashBook));
qbdsBankAccountTable = query.dataSourceTable(tableNum(BankAccountTable));
qbdsBankAccountTrans = query.dataSourceTable(tableNum(BankAccountTrans));
i have to add datasource here as well for default dimension view??
Refer to the below code.
query buildQueryBusinessUnit() { QueryBuildDataSource qbds; Query query = new Query(); qbds = query.addDatasource(tablenum(DefaultDimensionView)); qbds.addRange(fieldnum(DefaultDimensionView, Name)).value(queryvalue("BusinessUnit")); return query; }
Thanks,
Girish S.
André Arnaud de Cal...
292,031
Super User 2025 Season 1
Martin Dráb
230,868
Most Valuable Professional
nmaenpaa
101,156