Example 5: Synthetic placeholders in delete prompts

Uses OnGetVariableValue to resolve a <var>VarID</var> placeholder that does not correspond to any field of the active dataset.

Scenario

The delete confirmation should name the order, the customer, and who is currently logged in - the first two are dataset fields, the third is not:

FGrid.DelRowQuestion := 'Delete order <var>OrderNo</var> for <var>CustomerName</var>'
  + ', confirmed by <var>CurrentUser</var>?';

The handler

procedure TfrmOrders.GridGetVariableValue(VarID: string; var Value: string);
begin
  if SameText(VarID, 'CurrentUser') then
    Value := Session.LoggedInUserName
  else
    Value := '?';  // unrecognized placeholder - keep it visible instead of blank
end;

Why it works this way

See Also

(C) 2026 Easygate, Lda