General Component
Fnd_Gen_BugAlert
Fnd_Gen_BugAlert (method{; details})
Parameters
| Parameter | Type | Description |
|---|---|---|
| method | Text | Method name |
| details | Text | Details about the problem (optional) |
Description
The Fnd_Gen_BugAlert method provides a simple method for the developer to notify the end-user of a problem that can happen only as a result of a programming error. For example, if you create a method that requires two parameters, you can use 4D’s Count parameters function to determine if two parameters have been passed. If the wrong number of parameters has been passed, you would use the Fnd_Gen_BugAlert method to alert the end-user to the problem. The Fnd_Gen_BugAlert method will describe the problem and ask the user to notify the database developer. If(Count parameters<2)
Fnd_Gen_BugAlert (Current method name;"Too few parameters were passed.")
End if
If you want to provide a more specific error message, pass a complete sentence as the second parameter. This sentence will be displayed following the first sentence in the error message as shown below.
Do not use 4D’s Current method name function as the first parameter to this method if you are calling it from a 4D component designed for 4D 2003.2 or earlier. With these earlier versions of 4D 2003, 4D does not return the method’s name if Current method name is called from a method in a component. Instead, you must hard-code the current method name. This method is intended to display errors in the code, not runtime errors that occur because a file is not where you expect it to be, or a value is not entered properly. Put this method only in places where you assume it will never be called. After displaying the alert, this routine calls 4D’s TRACE command to help you debug the error. The TRACE command is ignored if the database is compiled.
Extracted source text
Fnd_Gen_BugAlert (method{; details})
Parameter Type Description
method Text Method name
details Text Details about the problem (optional)
The Fnd_Gen_BugAlert method provides a simple method for the developer to notify the end-user of a
problem that can happen only as a result of a programming error.
For example, if you create a method that requires two parameters, you can use 4D’s
Count parameters function to determine if two parameters have been passed. If the wrong number
of parameters has been passed, you would use the Fnd_Gen_BugAlert method to alert the end-user to
the problem. The Fnd_Gen_BugAlert method will describe the problem and ask the user to notify the
database developer.
If(Count parameters<2)
Fnd_Gen_BugAlert (Current method name;"Too few parameters were passed.")
End if
If you want to provide a more specific error message, pass a complete sentence as the second parameter.
This sentence will be displayed following the first sentence in the error message as shown below.
Do not use 4D’s Current method name function as the first parameter to this method if you are
calling it from a 4D component designed for 4D 2003.2 or earlier. With these earlier versions of 4D
2003, 4D does not return the method’s name if Current method name is called from a method in a
component. Instead, you must hard-code the current method name.
This method is intended to display errors in the code, not runtime errors that occur because a file is not
where you expect it to be, or a value is not entered properly. Put this method only in places where you
assume it will never be called.
After displaying the alert, this routine calls 4D’s TRACE command to help you debug the error. The
TRACE command is ignored if the database is compiled.