DexError()
The DexError() function creates an error dialog box displaying the specified string. Processing stops while the system waits for the user to respond.
Syntax
DexError(prompt)
Parameters
• prompt - A string with the message to be displayed in the dialog box.
Return value
The boolean value true.
Comments
The dialog box has one button labeled OK. The icon displayed is the standard error icon for the operating system.
Examples
The following C# example uses the DexError() function to display any unexpected exception that occurs when the Estimate Freight form is created.
static void OpenEstimateFreight(object sender, EventArgs e) { if (EstimateFreightForm == null) { try { EstimateFreightForm = new EstimateFreight(); } catch (Exception ex) { Dynamics.Forms.SyVisualStudioHelper.Functions.DexError .Invoke(ex.Message); } } // Always show and activate the WinForm EstimateFreightForm.Show(); EstimateFreightForm.Activate(); }
The following Visual Basic example uses the DexError() function to display any unexpected exception that occurs when the Estimate Freight form is created.
Shared Sub OpenEstimateFreight(ByVal sender As Object, ByVal e As EventArgs) If EstimateFreightForm Is Nothing Then Try EstimateFreightForm = New EstimateFreightForm() Catch ex As Exception Dynamics.Forms.SyVisualStudioHelper.Functions.DexError _ .Invoke(ex.Message) End Try End If ' Always show and activate the WinForm EstimateFreightForm.Show() EstimateFreightForm.Activate() End Sub