...
// Add the following lines.
LOCAL PROCEDURE CheckCashBankRepMandatory@1170000();
VAR
CashBankReport@1170000 : Record 12300;
ExchRateAdjmtReg@1170001 : Record 86;
BEGIN
IF "Cash/Bank Report Mandatory" THEN BEGIN
IF HasExchRateAdjmtReg THEN
RaiseCashBankRepErr(ExchRateAdjmtReg.TABLECAPTION)
END ELSE
IF HasCashBankLedgEntries THEN
RaiseCashBankRepErr(CashBankReport.TABLECAPTION);
END;
LOCAL PROCEDURE HasExchRateAdjmtReg@1170006() : Boolean;
VAR
ExchRateAdjmtReg@1170000 : Record 86;
BEGIN
ExchRateAdjmtReg.SETRANGE("Account Type",ExchRateAdjmtReg."Account Type"::"Bank Account");
ExchRateAdjmtReg.SETRANGE("Account No.","No.");
EXIT(NOT ExchRateAdjmtReg.ISEMPTY);
END;
LOCAL PROCEDURE HasCashBankLedgEntries@1170007() : Boolean;
VAR
BankAccLedgEntry@1170000 : Record 271;
BEGIN
IF NOT BankAccLedgEntry.RECORDLEVELLOCKING THEN
BankAccLedgEntry.SETCURRENTKEY("Bank Account No.","Cash/Bank Report Cons. No.","Cash/Bank Report Position");
BankAccLedgEntry.SETRANGE("Bank Account No.","No.");
BankAccLedgEntry.SETFILTER("Cash/Bank Report Cons. No.",'<>0');
EXIT(NOT BankAccLedgEntry.ISEMPTY);
END;
LOCAL PROCEDURE RaiseCashBankRepErr@1170001(RelatedTableCaption@1170000 : Text[80]);
BEGIN
ERROR(
Text12300,"Cash/Bank Report Mandatory",FIELDCAPTION("Cash/Bank Report Mandatory"),
BankAccLedgEntry.TABLECAPTION,RelatedTableCaption)
END;
// End of the lines.
BEGIN
...