hard core the invoice date in the form

Hi all,

first of all i am using ax 2012 r3 I have a question when ever i am creating a sales order and then click on invoice then a form come up for where we select the qty as packing slip or invoice and there is a tab called set up there we have a field called invoice date as default it is showing as today date according the time zome.

I want to write a logic to change the invoice date based on business requirement so where should i write the code so that every time we click on invoice the date should be changed according to the condition and gets invoiced later .

I know we can change the date by while invoicing by calling the

salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice); // Get a new instance of SalesFormletter
salesFormLetter.transDate(SystemDateGet()); // Set the invoicedate
salesFormLetter.update(salesTable, // SalesTable
SalesUpdate::All, // Quantity to update (SpecQty)
AccountOrder::None, // AccountOrder
false, // Proforma only?
true); // Printout?

but in my case the user will do invoicing manually put the date should be changed automiatically…

any help guys???

The date gets initialized here,


by calling this.parmTransDate(), it by defaults sets the systemDate, but you can overwrite it based on a valid business requirement.