When an invoice is created and posted for a sales order, it is added to the Invoice journal. If an applicable document flow with direction 'Outbound' and type 'Invoice' exists, also a record is added to the Outbound message queue. When this record is processed, the 'Sales - Invoice to XML' message is run. As a result, this message gets the data from the journal as defined in the outbound message queue record and creates and sends an EDI invoice message file to your customer.