I have duplicated the table of PurchLine and set it in the properties as tempDB. I've created a new form, and put as a datasource the temptable. I've deleted all methods and most of the fields of the tempDB which i got after the duplicate. So, I've put some of the fields to the grid of the form. Took the form and put it in a menu item/ display, and actually put the menu item I've created at the action pain of an existing form in AOT (PurchTableListPage)
I have this task where I need to open the PurchTableListPage and if select a PurchID and click on the button I've created earlier, it has to show me the form I've created with all the data of that PurchID. all this data are from PurchLine.
here is my code
public class FormRun extends ObjectRun
{
NewPurchLine temptable;
PurchLine purchline;
purchId purchId;
}
public void init()
{
super();
PurchLine = element.args().record();
//take with args the header / purchId.....
temptable = this.populatetmpdata(purchline.purchId);
NewPurchLine.linkPhysicalTableInstance(temptable);
}
public NewPurchLine populatetmpdata(PurchIdBase _Purchid)
{
NewPurchLine tmpTable;
while select purchline
where purchline.purchid == _Purchid
&& Purchline.PurchQty >= 20
{
tmpTable.PurchId = purchline.PurchId;
tmpTable.PurchQty = purchline.PurchQty;
tmpTable.ItemId = purchline.ItemId;
tmpTable.Name = purchline.Name;
tmpTable.PurchPrice = purchline.PurchPrice;
tmpTable.VendAccount = purchline.VendAccount;
tmpTable.Insert();
}
return tmpTable;
}
any idea of where my mistake is?
I get this error when I click the button on form:
Error executing code: Wrong argument types in variable assignment.
Stack trace
(C)\Forms\NewForm\Methods\init - line 5 // newForm is the form I've created
(C)\Classes\SysSetupFormRun\init - line 3
(C)\Classes\FormFunctionButtonControl\Clicked