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();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment