views:

171

answers:

2

I'm still in the planning on how to proceed phase with this, but at a customer site, they are moving to invoicing through axapta. now the axapta has been used for years, and the invoices they are generating for it is -only- using invoice lines.

While this is an acceptable solution, it is still preferred if there's some way to extend/program/customize Axapta as to be able to import textual lines that will be hooked on to an invoice that is being sent out.

I'm not really sure as to where to start attacking this problem, i've googled some, checked out some "axapta" sites, but most of what i see either deals with newer versions (this is version 3 sp4, which is about six-ish years old).

If it's possible to do, in general terms, what would the procedures be? Would it involve x++ code?

Thanks for any input!

+1  A: 

Use document handling to attach a note to either the sales order header or the sales order lines. Set the Restriction field of the note to External. You can control printing of notes on invoices under Account receivable/Setup/Forms/Form setup, on the Invoice tab in the Note section.

To fully customize the look of an invoice, edit the report SalesInvoice.

Jay Hofacker
There is no way to import a text note from file though.You may attach a text file, but it will not be shown on the invoice.
Jan B. Kjeldsen
You can import into the DocuRef table, though it will be a little complicated because you need to know the RecId of the SalesTable or SalesLine record you are referencing.
Jay Hofacker
Do you have any link to documentation on this DocuRef table and how it's related to the printing of invoices?
cairnz
+1  A: 

Follow Jay's advice and add the preformatted text to document handling.

Add the following method to the DocuRef table:

static void addNote(Common record, str notes)
{
    DocuRef docuRef;
    ;
    docuRef.clear();
    docuRef.TypeId       = CustFormletterDocument::find().DocuTypeInvoice;
    docuRef.Restriction  = DocuRestriction::External;
    docuRef.RefTableId   = record.TableId;
    docuRef.RefRecId     = record.RecId;
    docuRef.RefCompanyId = record.dataAreaId;
    docuRef.Notes        = notes;
    docuRef.insert();
}

In your import code somewhere after the insert of the sales table record:

DocuRef::addNotes(salesTable, preformattedtext);

You will have to change your customer form setup to allow to print notes on the invoice.

Jan B. Kjeldsen
Thanks for your comments and answers, they have been helpful in guiding customer in the right direction.
cairnz