Hi,
i am trying to extend the clicked method in the custfreeinvoce form button ButtonCustPostInvoiceJob .
But i keep getting the following error object reference not set .please find below my code
thanks
[ExtensionOf(formControlStr(CustFreeInvoice,ButtonCustPostInvoiceJob))]
final class custfreetext_extension
{
public void clicked()
{
CustInvoiceTable _CustInvoiceTable;
propinvoice _propinvoice;
FormButtonControl bc = any2Object(this) as FormButtonControl;
FormDataSource ds = bc.formRun().dataSource(tableStr(CustInvoiceTable));
next clicked();
_CustInvoiceTable = ds.cursor();
if (_CustInvoiceTable.Posted==NoYes::Yes)
{
while select forupdate _propinvoice where _propinvoice.Propinvoiceid==_CustInvoiceTable.Propinvoiceid
{
_propinvoice.InvoiceId=_CustInvoiceTable.InvoiceId;
_propinvoice.update();
info("invoice updated");
}
}
}
}