Skip to content

confirmBox() Function Documentation - Merciglobal Cloud ERP¶

Overview¶

The confirmBox() function is a UI utility used within the Merciglobal Cloud ERP to prompt users with a confirmation dialog. It is ideal for scenarios where user input confirmation is required before executing sensitive actions like deleting records, saving changes, or submitting forms.

🔧 Function Signature¶

confirmBox(wintitle='Notes', title='Input', callbackOk, callbackCancel)

Parameters¶

Parameter Type Required Description
wintitle string No Title of the window or popup header. Defaults to 'Notes'.
title string No Message or question displayed in the dialog. Defaults to 'Input'.
callbackOk function Yes Function executed when the user clicks OK.
callbackCancel function Yes Function executed when the user clicks Cancel.

Example Usage¶

confirmBox(
  'Delete Confirmation',
  'Are you sure you want to delete this invoice?',
  function() {
    console.log('User confirmed deletion.');
    deleteInvoice();
  },
  function() {
    console.log('User canceled the operation.');
  }
);

Best Practices¶

  • Always use clear and concise messages in the title to avoid user confusion.
  • Use for actions that are not easily reversible.
  • Ensure callbackOk and callbackCancel are well-handled to maintain smooth UX.

Use Case in Merciglobal Cloud ERP¶

This function is commonly used in: - 🔒 Secure delete prompts in Accounting and Inventory modules. - 💾 Save confirmation dialogs in CRM forms. - 🚫 Exit or navigation warnings with unsaved changes.

Benefits¶

  • Ensures better user decision-making
  • Reduces unintended actions
  • Enhances application interactivity

Notes for Developers¶

  • This function should be styled in consistency with Merciglobal’s UI framework.
  • Consider accessibility for keyboard-only users.
  • Wrap the function inside ERP module components if context-specific logic is involved.

For more UI components and best practices, refer to the Merciglobal Cloud ERP Developer Guidelines.