While defining record level security for the user group's if there are too many queries instead of specifying based on customer group if user's define based on customer id etc.. and too many wild characters like (*). then client machine performance will be very slow and system may hangsup and some times u get an errror like "binding for buffer allocation space".
Thanks,
Daxing :)
Tuesday, July 30, 2013
Lookup on breakdown structure defined on a perticular projectid:
For a perticular projectid there can be any number of work breakdown structure defined based on activityid. If you develop a new table and form and get that plan names besed on selected project then : Here NewPaymentPlanTable is the new table.
Below code is on form control - lookup method:
public void lookup()
{
HierarchyTreeTable hierarchyTreeTable,hierarchyTreeTable1;
ProjTable projTable1;
Query query = new Query();
SysTableLookup sysTableLookup;
projTable1 = ProjTable::find(NewPaymentPlanTable_ProjId.text());
super();
select firstonly Name,ElementNumber from HierarchyTreeTable where HierarchyTreeTable.Name == projTable1.ProjId;
select firstOnly ElementNumber from hierarchyTreeTable1 where hierarchyTreeTable1.ParentElementNumber == hierarchyTreeTable.ElementNumber;
sysTableLookup = SysTableLookup::newParameters(tableNum(hierarchyTreeTable), this);
// Add name field to be shown in the lookup form.
sysTableLookup.addLookupfield(fieldNum(HierarchyTreeTable, SiblingNumber));
sysTableLookup.addLookupfield(fieldNum(HierarchyTreeTable, Name));
sysTableLookup.addLookupfield(fieldNum(HierarchyTreeTable, ElementNumber));
sysTableLookup.addLookupfield(fieldNum(HierarchyTreeTable, ElementNodeType));
query = new Query();
query.addDataSource(tableNum(HierarchyTreeTable)).addRange(fieldNum(HierarchyTreeTable, ParentElementNumber)).value(queryValue(hierarchyTreeTable.ElementNumber));
sysTableLookup.parmQuery(query);
// Perform the lookup.
sysTableLookup.performFormLookup();
}
Below code is on form control - lookup method:
public void lookup()
{
HierarchyTreeTable hierarchyTreeTable,hierarchyTreeTable1;
ProjTable projTable1;
Query query = new Query();
SysTableLookup sysTableLookup;
projTable1 = ProjTable::find(NewPaymentPlanTable_ProjId.text());
super();
select firstonly Name,ElementNumber from HierarchyTreeTable where HierarchyTreeTable.Name == projTable1.ProjId;
select firstOnly ElementNumber from hierarchyTreeTable1 where hierarchyTreeTable1.ParentElementNumber == hierarchyTreeTable.ElementNumber;
sysTableLookup = SysTableLookup::newParameters(tableNum(hierarchyTreeTable), this);
// Add name field to be shown in the lookup form.
sysTableLookup.addLookupfield(fieldNum(HierarchyTreeTable, SiblingNumber));
sysTableLookup.addLookupfield(fieldNum(HierarchyTreeTable, Name));
sysTableLookup.addLookupfield(fieldNum(HierarchyTreeTable, ElementNumber));
sysTableLookup.addLookupfield(fieldNum(HierarchyTreeTable, ElementNodeType));
query = new Query();
query.addDataSource(tableNum(HierarchyTreeTable)).addRange(fieldNum(HierarchyTreeTable, ParentElementNumber)).value(queryValue(hierarchyTreeTable.ElementNumber));
sysTableLookup.parmQuery(query);
// Perform the lookup.
sysTableLookup.performFormLookup();
}
lookup for SalesId based on customer id in the payment journal ->AR (Ax2012)
public void lookup()
{
CustTable custTable;
SalesTable salesTable;
Query query = new Query();
SysTableLookup sysTableLookup;
LedgerDimensionAccount ledgerDim;
ledgerDim = DimensionStorage::getDynamicAccount(LedgerJournalTrans_AccountNum.valueStr(), LedgerJournalACType::Cust);
custTable = CustTable::find(DimensionAttributeValueCombination::find(ledgerDim).DisplayValue);
super();
// Only user defined dimensions will have a financial tag category
select firstonly CustAccount from salesTable where salesTable.CustAccount == custTable.AccountNum;
sysTableLookup = SysTableLookup::newParameters(tableNum(SalesTable), this);
// Add name field to be shown in the lookup form.
sysTableLookup.addLookupfield(fieldNum(SalesTable, SalesId));
sysTableLookup.addLookupfield(fieldNum(SalesTable, CustAccount));
query = new Query();
query.addDataSource(tableNum(SalesTable)).addRange(fieldNum(SalesTable, CustAccount)).value(queryValue(custTable.AccountNum));
sysTableLookup.parmQuery(query);
// Perform the lookup.
sysTableLookup.performFormLookup();
}
{
CustTable custTable;
SalesTable salesTable;
Query query = new Query();
SysTableLookup sysTableLookup;
LedgerDimensionAccount ledgerDim;
ledgerDim = DimensionStorage::getDynamicAccount(LedgerJournalTrans_AccountNum.valueStr(), LedgerJournalACType::Cust);
custTable = CustTable::find(DimensionAttributeValueCombination::find(ledgerDim).DisplayValue);
super();
// Only user defined dimensions will have a financial tag category
select firstonly CustAccount from salesTable where salesTable.CustAccount == custTable.AccountNum;
sysTableLookup = SysTableLookup::newParameters(tableNum(SalesTable), this);
// Add name field to be shown in the lookup form.
sysTableLookup.addLookupfield(fieldNum(SalesTable, SalesId));
sysTableLookup.addLookupfield(fieldNum(SalesTable, CustAccount));
query = new Query();
query.addDataSource(tableNum(SalesTable)).addRange(fieldNum(SalesTable, CustAccount)).value(queryValue(custTable.AccountNum));
sysTableLookup.parmQuery(query);
// Perform the lookup.
sysTableLookup.performFormLookup();
}
Subscribe to:
Posts (Atom)