showerr()
Function Documentation¶
A utility function used in Merciglobal Cloud ERP to quickly display error notifications in a consistent and user-friendly format.
Purpose¶
The showerr()
function provides a lightweight and customizable way to show error messages to users, typically used during form submissions, AJAX failures, or invalid input handling.
Syntax¶
showerr(caption = '', timeoutSec = 0, position = 'topRight', focusOnClose, bgcolor = '')
Parameters¶
Parameter | Type | Description |
---|---|---|
caption |
string |
The message to display in the error popup. |
timeoutSec |
int |
How long the popup should remain visible (in seconds). Set to 0 for persistent until closed. |
position |
string |
Location on the screen where the popup appears. Default is 'topRight' . |
focusOnClose |
boolean |
(Optional) If true , focuses the triggering element on popup close. |
bgcolor |
string |
(Optional) Background color of the error popup. Accepts CSS color values (e.g., #ff0000 ). |
Usage Examples¶
Example 1: Basic Error Message¶
showerr('Invalid email address');
Example 2: Timed Error with Custom Position and Color¶
showerr('Session expired', 5, 'bottomLeft', true, '#ff4d4f');
Best Practices¶
- Keep error
caption
clear and concise. - Use
timeoutSec
wisely to avoid user frustration. - Prefer
topRight
orbottomRight
positions for better visibility. - Set
focusOnClose
totrue
when dealing with input validations.
Common Use Cases in Merciglobal Cloud ERP¶
- Form validation errors in CRM, Inventory, or HR modules.
- API failure responses (e.g., when syncing with third-party services).
- System alerts (e.g., session timeouts or permission denied messages).
📞 Need Help?¶
Reach out to the Merci Developer Support or contact your ERP consultant for help integrating or customizing the showerr()
behavior.