KI (2017.2+) DR—'Print to File' function on invoice preview screen when clicked do not include the invoice number
The following issue has been identified and subsequently replicated by MYOB Support in Exo Business version 2019.4
Please note, this issue has been present since version 2017.2 first added the Print to File button. The problem is with the workflow which has never worked any way differently.
Issue
When ‘Print to file’ icon is used in Invoice preview screen, it doesn’t include the Invoice number whereas when user clicks on print icon, the resulting ‘Print’ pop up window includes the invoice number in Print to file location.
Workarounds
Alternative workflow
Click on print and select print to file option for invoice number to be included as part of file name. (1 extra click)
Clarity code workaround
You can customise the clarity code of a form to overwrite the TEMPLATE.FIleName. This name controls the report destination.
Example clarity code for this customisation is below, please note, it is recommended this logic be on the END FIRST PASS event because otherwise multi-pass reports can construct incorrect names.
procedure ReportOnEndFirstPass;
VAR
newtext: STRING;
begin
newtext := Report.Template.FileName;
while Pos('\', newtext)>0 do
begin
Delete(Newtext, 1, Pos('\', Newtext));
end;
Report.PrinterSetup.DocumentName:= newtext;
NewText := StringReplace(NewText, '.CLF', '', True);
Report.Template.FileName:=newtext+'_'+Master['Seqno']+'.CLF';
end;
Please make sure Master['SEQNO'] is replaced with the relevant field for your form, such as INVNO, and .CLF could be replaced with .CLR
The chief problem with this workaround is that it makes it incredibly annoying to save changes to forms in the Clarity report designer, as previewing the report will give you an incorrect form name to save.
Resolution
Attached to Problem ticket 169980618631 for resolution in a future release.