[.NET Snippet] Getting the mode of a form in a macro

  • Updated

Sometimes you need to know what mode (Add/Update/Ok/Find) a form is in. This you can get this using the .NET Code: 

(Right-click in a macro to get the .NET code menu item).

Code:

switch(form.Mode)
{
case BoFormMode.fm_FIND_MODE:
return "Find";
case BoFormMode.fm_OK_MODE:
return "Ok";
case BoFormMode.fm_UPDATE_MODE:
return "Update";
case BoFormMode.fm_ADD_MODE:
return "Add";
default:
return "Unknown";
}

You can then use it in a macro like:

Was this article helpful?

3 out of 3 found this helpful

Comments

0 comments

Please sign in to leave a comment.