Search code examples
blueprism

How do i create a message box in blue prism?


I need to create a couple of message boxes in blue prism for a demo. This is how far I have gotten:

1. I am using the code stage
2. In the Inputs tab I have declared my Message and have given it a value
3. In the Code tab I have declared: `MessageBox.Show(Message)`

When I validate the code I get a compiler error: "

'MessageBox' is not declared "

Guidance is greatly appreciated. Thanks in advance!


Solution

  • You need to import System.Windows.Forms to your namespace in order to reference the MessageBox object the way you currently have in your code.

    1. Open the initialize page of your object. Right-click the Description box (located in the upper-left of your page, by default) and select "Properties".

    2. Click over to the Code Options tab.

    3. Add a Namespace Import by clicking the Add button to the right of the "Namespace Imports" table. Set the new line item's value to "System.Windows.Forms".

    Reset and re-run and you should be good to go to use MessageBox().