Tuesday, October 22, 2013

tmpdata

PSATmpSchedEmplResource             tEmplResource;
tEmplResource.setTmpData(tmpSchedEmplResource);

update data in tEmplResource
once tEmplResource is out of the scope, it is deleted. 
Updated data is still at tmpSchedEmplResource

tmpSchedEmplResource contains the data, after setTmpData is called, tEmpResource will contains the data. Edit/Update data in tEmplResource will update data in tmpScheEmplResource. 


1. Create temporary table as TmpTestTable with 3 fields(ItemId,Itemname,ItemGroup).
2. Create a form as TempTestTable and attach the table as datasource
3. Create a new method on the form and copy the following code

TmpTestTable populateRecords(ItemGroupId _itemGroupId)
{
 
TmpTestTable tmpTable;
InventTable inventTable;
;

while select inventTable
where inventTable.ItemGroupId == _itemGroupId
{
tmpTable.Itemid = inventTable.ItemId;
tmpTable.ItemName = inventTable.ItemName;
tmpTable.Itemgroup = inventTable.ItemGroupId;
tmpTable.insert();
}

return tmpTable;


4. Call the above method in init() after super as below
public void init()
{
 
super();

// Call the setTmpData method to attach records to datasource
TmpTestTable.setTmpData(element.populateRecords("Parts"));
}

No comments:

Post a Comment