Root > How to... > ...change exception dialog? > ...make "Steps to reproduce" mandatory?

...make "Steps to reproduce" mandatory?

Previous pageReturn to chapter overviewNext page   

This feature is not implemented as a build-in feature, because a typical user would prefer to close/terminate your app rather than type anything in. Especially if you try to force him. Result: you will get less reports. That is probably not what you want?

 

If you absolutely need to understand what user was doing prior to exception - it is way better to use logging instead. You can use EurekaLog's logging or any 3rd party framework. For example, if you want to use EurekaLog's logging - you can start by placing this code into your functions:

 

uses
  ELogging,   // for ELogEnter
  EDebugInfo; // for __UNIT__ and __FUNCTION__
 
procedure TForm1.Button1Click(Sender: TObject);
begin
  ELogEnter(__UNIT__ + '.' + __FUNCTION__).C;
 
  // Your actual code goes here...
end;

 

Anyway, if you still want to make "steps to reproduce" field mandatory - you can do this by altering behavior of exception dialog class, so it won't allow empty "steps to reproduce" field. For example:

 

uses
  EDialog,                // for RegisterDialogClassFirst
  EDialogWinAPIMSClassic, // for TMSClassicDialog
  EModules;               // for CurrentEurekaLogOptions
 
type
  TMSClassicDialog = class(EDialogWinAPIMSClassic.TMSClassicDialog)
  protected
    function AssignOnCloseData: Boolean; override;
  end;
 
function TMSClassicDialog.AssignOnCloseData: Boolean;
begin
  // Call inherited implementation to fill reproduce text from dialog
  // (and other actions)
  Result := inherited AssignOnCloseData;
 
  // Block dialog closing when no reproduce steps are present
  if Trim(ReproduceText) = '' then
  begin
    MessageBox('Please, describe what you were doing'

      'Not enough information', MB_OK or MB_ICONWARNING);
    Result := False;
  end;
end;
 
initialization
  // Replace build-in dialog with our customizations
  RegisterDialogClassFirst(TMSClassicDialog);

 
  // Additionally, change dialog text to indicate that the field is required
  CurrentEurekaLogOptions.CustomizedTexts[mtMSDialog_HowToReproduceCaption] :=
    'What were you doing when the problem happened (mandatory)?';
end.

 

 

See also:




Send feedback... Build date: 2023-09-11
Last edited: 2023-03-07
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/how_to_make_steps_to_reproduce_mandatory.php