Skip to content

How to force JustOn to create a new transaction CSV?

In certain cases (like layout errors, text typos etc.) you may have to regenerate the transaction CSV as attached to an invoice. Proceed as follows:

  1. Open the invoice for which you want to create a new transaction CSV file.
  2. In the Notes & Attachments section, delete the attached transaction CSV.
  3. Select the checkbox field ON_AddToCsv on the source object (see Controlling Fields).
  4. In the Execute Anonymous Apex tool of the Developer Console, execute the following code, applying your details:
Set<Id> invoiceIds = new Map<Id, sObject>([SELECT Id FROM ONB2__Invoice__c WHERE <invoice condition>]).keySet();

new ONB2.ChainRunner().execute(
    new ONB2.ChainFactory().getForBatchNames(new List<String>{'TransactionCsvBatchRenderHelper'})
    .setParameters(
        new Map<String, Object>{'invoiceIds' => invoiceIds}
    )
);

▶ This creates new transaction CSV files for the selected invoices.