Hello Experts,
The execution result is as expected, but the title error appears when debugging.
How can I avoid this compilation error?
Designed as follow.
There are a string control, an OK button and a Grid on a form.
Select a value in the string control and press the OK button to display the processing result in the Grid.
It is implemented as below.
1.override form’s init() method and initialize another tempDB buffer of the same type and link its physical instance to the current data source buffer.
2. I created a method in the form method that inserts data into a TempDB table whose table type is TempDB.
3. After pressing the OK button, get the form's string controls and call the PopulatesRecords method to insert data into the TempDB table. Then link the returned TemTable to the form data source.
4.The form's data source is set to a TempDB table.
The following is code.
public class TestSearchEnumForm extends FormRun
{
public void init()
{
TestInfoTemp tempTable;
super();
TestEnumName testEnumName = EnumName.text();
delete_from tempTable;
tempTable = element.populateRecords(testEnumName);
TestInfoTemp.linkPhysicalTableInstance(tempTable);
}
public TestEnumInfoTemp populateRecords(TestEnumName _testEnumName)
{
TestInfoTemp tempTable;
if (_testEnumName)
{
delete_from tempTable;
ttsbegin;
tempTable.field1 = text1;
tempTable.field2 = text2;
tempTable.insert();
}
return tempTable;
}
[Control("CommandButton")]
class OKCommandButton
{
///
///
///
public void clicked()
{
TestEnumInfoTemp tempTable;
super();
// get value from form string control.
TestEnumName testEnumName = EnumName.text();
DictEnum dictEnum = new DictEnum(enumName2Id(testEnumName));
if (dictEnum)
{
// Insert data to TempDB table.
tempTable = element.populateRecords(testEnumName);
delete_from TestEnumInfoTemp;
// TestEnumInfoTemp is the form datasource whose table type is TempDB.
TestEnumInfoTemp.linkPhysicalTableInstance(tempTable);
}
}
}
}
Any advice would be greatly appreciated.