D365FO showMarkupTrans false in Sales Invoice

When you have charges added to your Sales Invoice, they will be reflected in your report data source, including setting the ShowMarkupTrans field to true.

However, this works only for Finnish legal entities.

If you’d like to show the charges in your report data source, you can customize the DSP class to populate the data source with the MarkupTrans node.

private void addMarkupTrans(DocXmlRecord _dataRecord, Common _tableRecord)
    {
        void addMarkupTransDataRecord(MarkupTrans _markupTrans)
        {
            DocXmlRecord markupTransDataRecord = _dataRecord.addChildRecord(_markupTrans);
            markupTransDataRecord.addField(fieldStr(MarkupTrans, LineNum));

            markupTransDataRecord.addField(fieldStr(MarkupTrans, MarkupCode));
            markupTransDataRecord.addField(fieldStr(MarkupTrans, Txt));
            markupTransDataRecord.addField(fieldStr(MarkupTrans, Value));
            markupTransDataRecord.addField(fieldStr(MarkupTrans, CurrencyCode));
            markupTransDataRecord.addField(fieldStr(MarkupTrans, TaxGroup));
            markupTransDataRecord.addField(fieldStr(MarkupTrans, TaxItemGroup));
        }

        MarkupTrans markupTrans;
        boolean markupTransDataRecordAdded = false;

        while select markupTrans
              where markupTrans.TransRecId == _tableRecord.RecId &&
                    markupTrans.TransTableId == _tableRecord.TableId &&
                    !markupTrans.IsDeleted
        {
            addMarkupTransDataRecord(markupTrans);
            markupTransDataRecordAdded = true;
        }

        // Add an empty record but only at design time, if no markup record exists.
        if (!this.isRuntime() && !markupTransDataRecordAdded)
        {
            markupTrans.clear();
            addMarkupTransDataRecord(markupTrans);
        }
    }

When we add the Markup transactions how do we include the CalculatedAmount for each line charge so that the line charges can be broken out for each line and displayed on the invoice?

Hello @CCC,

To see the charges on the lines of the Sales Invoice, you need to call the method for both the header and the lines.
So, for the header charges, call the method from addDataFieldsForHeader(), and for the line charges - from sil_addMainLines().

Thanks! I have a similar requirement on the Sales Order confirmation. What methods would apply there?

For the Sales Order confirmation, that would be the addDataFieldsForLine_Trans() method.