Displaying custom error message

Displaying custom error message

Post by Paul Freedma » Sat, 07 Jun 2003 20:25:22



I have a form where for reference purposes I display a text field that is
based on a calculation.

It is possible that users will try and type in this field, I want to
suppress the standard error message & replace with my own.

Can this be achieved outside of a script

Regards

Paul Freedman

 
 
 

Displaying custom error message

Post by Glenn Schwand » Sat, 07 Jun 2003 23:25:05


You can eliminate the error message by removing access to the field (under
Field Format, uncheck "allow entry into field").


Quote:> I have a form where for reference purposes I display a text field that is
> based on a calculation.

> It is possible that users will try and type in this field, I want to
> suppress the standard error message & replace with my own.

> Can this be achieved outside of a script

> Regards

> Paul Freedman


 
 
 

Displaying custom error message

Post by Paul Freedma » Tue, 10 Jun 2003 18:19:04


The problem is the content of the text field is quite long and needs the
vertical scroll bar, that is why I need an "active field to display the
text.

I created the calc field for this purpose as it cannot be modified but
unfortunately does have an unfriendly error message.

Paul

> You can eliminate the error message by removing access to the field (under
> Field Format, uncheck "allow entry into field").



> > I have a form where for reference purposes I display a text field that
is
> > based on a calculation.

> > It is possible that users will try and type in this field, I want to
> > suppress the standard error message & replace with my own.

> > Can this be achieved outside of a script

> > Regards

> > Paul Freedman

 
 
 

Displaying custom error message

Post by Glenn Schwand » Tue, 10 Jun 2003 23:09:08


Use the original text field instead of the calculation field and use data
validation to prohibit changes and display your custom message.  Assuming
that the layout you want to limit changes on is called "DataEntry", use the
following for validation by calculation for your text field:

Status (CurrentLayoutName) <> "DataEntry"

Make the validation strict and enter your custom message as desired.

Alternately, if you want only one layout where you CAN change the text
field, validate as follows:

Status (CurrentLayoutName) = "ChangesAllowedLayout"


> The problem is the content of the text field is quite long and needs the
> vertical scroll bar, that is why I need an "active field to display the
> text.

> I created the calc field for this purpose as it cannot be modified but
> unfortunately does have an unfriendly error message.

> Paul


> > You can eliminate the error message by removing access to the field
(under
> > Field Format, uncheck "allow entry into field").



> > > I have a form where for reference purposes I display a text field that
> is
> > > based on a calculation.

> > > It is possible that users will try and type in this field, I want to
> > > suppress the standard error message & replace with my own.

> > > Can this be achieved outside of a script

> > > Regards

> > > Paul Freedman

 
 
 

Displaying custom error message

Post by Paul Freedma » Wed, 11 Jun 2003 00:41:02


Excellent


> Use the original text field instead of the calculation field and use data
> validation to prohibit changes and display your custom message.  Assuming
> that the layout you want to limit changes on is called "DataEntry", use
the
> following for validation by calculation for your text field:

> Status (CurrentLayoutName) <> "DataEntry"

> Make the validation strict and enter your custom message as desired.

> Alternately, if you want only one layout where you CAN change the text
> field, validate as follows:

> Status (CurrentLayoutName) = "ChangesAllowedLayout"



> > The problem is the content of the text field is quite long and needs the
> > vertical scroll bar, that is why I need an "active field to display the
> > text.

> > I created the calc field for this purpose as it cannot be modified but
> > unfortunately does have an unfriendly error message.

> > Paul


> > > You can eliminate the error message by removing access to the field
> (under
> > > Field Format, uncheck "allow entry into field").



> > > > I have a form where for reference purposes I display a text field
that
> > is
> > > > based on a calculation.

> > > > It is possible that users will try and type in this field, I want to
> > > > suppress the standard error message & replace with my own.

> > > > Can this be achieved outside of a script

> > > > Regards

> > > > Paul Freedman

 
 
 

1. Custom Task Error Handling - Displaying Custom Error Message

Hi,

I'm currently working on creating a custom task in VB6.
When it comes to error handling, the recommended error
handling procedure in MSDN is to bubble up the error to
the package event sink using oPackageEvent.onError().
Hence:

--- Sample Code Starts ---

Private Sub CustomTask_Execute(ByVal pPackage As Object,
ByVal pPackageEvents As Object, ByVal pPackageLog As
Object, pTaskResult As DTS.DTSTaskExecResult)
   On Error GoTo errHandler

   ' Business logic
   openConnection(param, param)

   pTaskResult = DTSTaskExecResult_Success
   Exit Sub

errHandler:

   pTaskResult = DTSTaskExecResult_Failure
   if Err.Number=xxxx Then closeConnection

   ' Bubble errors to the package eventsink
   If Not pPackageEvents Is Nothing Then
      pPackageEvents.OnError "CustomTask_Execute method
failed", Err.Number, Err.Source, Err.Description, "",
0, "", True
   End If

   Exit Sub
End Sub

--- Sample Code Ends ---

However, I notice that when error is raised, the specific
error message (Err.Description) will not be displayed on
the DTS Designer execution status dialog box. The only
message I'll get would be "The task reported failure on
execution".

I'm not sure if I have done it correctly. Anyone knows how
to get the custom error messages displayed?

Thanks!

Philip Tan

2. Cannot launch Enterprise Manager

3. Custom error message in custom Web publishing

4. Residential Forcasting Database

5. Display messages in custom DLL

6. How to get Access to TDataset?

7. How to replace SQL Errors with custom Error messages

8. Error handling and custom error messages

9. How to add custom DTS error messages?

10. Adding more robust error messages to a custom task

11. Custom Error Message Problems

12. Custom Error Messages