...
CLEAR(ChangeExchangeRate);
// Delete the following line.
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date");
// End of the deleted line.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
...
...
CLEAR(ChangeExchangeRate);
// Add the following lines.
IF "Posting Date" <> 0D THEN
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor","Posting Date")
ELSE
ChangeExchangeRate.SetParameter("Currency Code","Currency Factor",WORKDATE);
// End of the added lines.
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN BEGIN
VALIDATE("Currency Factor",ChangeExchangeRate.GetParameter);
CurrForm.UPDATE;
END;
CLEAR(ChangeExchangeRate);
...