Sunday, February 17, 2013

Default Descriptions

Quoting from MSDN,
“You can set up default text that is used to fill in the Description field for accounting entries that are posted automatically to the general ledger. Use the Default descriptions form to select the parameters or fields that are used to create the description text.”


Organization administration > Setup > Default descriptions.
In the Text field, enter the default description. You can type text in the field, or you can use one or more of the following free text variables:
·        %1 – Add the transaction date.
·        %2 – Add an identifier that corresponds to the document type that is being posted to the general ledger. For example, for transaction types that are related to invoices, the %2 variable adds the invoice number.
·        %3 – Add an identifier that is related to the document type that is being posted to the general ledger. For example, for transaction types that are related to invoices, the %3 variable adds the customer account number.
You can also define three more variables %4-%6, whose values differ from record to record. In case you are creating your own description (needs customization), you can define what values to come in these.

Behind the scenes
Class TransactionTxt drives this feature end to end. If you see the method txt(), the last line explains it all.  

return strfmt(txt, date2StrUsr(transDate, DateFlags::FormatAll), formLetterNum, voucherNum, key1, key2, key3);

In one of the customizations, I was required to populate description value on invoice transactions. I used a display method with below logic, the use of TransactionTxt class is self evident.



 

No comments:

Post a Comment