Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

Extension of button control clicked method

$
0
0

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");
}

}

}

}


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>