Loading
Uniconta
  • Search
  • Uniconta
    • Functions
      • General ledger
      • Orders & Purchase
      • Inventory & Logistics
      • Project
      • Production
      • Dashboard
      • Business Rules
      • ODATA ikonCustomisation
      • See all →
    • Apps
      • Invoice App Create Invoices
      • Upload App Submit reciepts & expenses
      • Assistant App Project Management
      • Work App Time Tracking
      • Authenticator App Two-Factor Authentication
    • Integrations
      • Add-on Store
    • Download & Login
      • Download Uniconta
      • Web Login
  • Developers
    • Build & Integrate
      • Get API Key
      • Download for Developers
      • Documentation
    • Resources & Code
      • Samples
      • Add-on solutions and users
    • Partner Ecosystem
      • Become an integration partner
      • Partner Portal
  • Insights
    • News
      • Latest News
      • Release Notes
      • Customer Stories
    • Get started
      • Try Uniconta
      • Book a Demo
  • Contact
  • Get Uniconta
  • Contact us
  • Find a reseller
Free trial signup

Developers Unipedia

  • API
    • API
    • User defined fields
    • User defined tables
    • Saving a Session
    • Posting an Invoice
    • Post Invoice and get PDF
    • Localization
    • Attach physical voucher to entities
    • Server-Login User
    • How to find C# Property from Uniconta Label
    • Minimize network traffic and optimize speed
    • Export pictures from Uniconta
    • OIOUBL Document Mapping and Send (NemHandel)
  • Plugins
    • Plugins
    • Debug Uniconta Plugins
    • Refreshing UI with plugins
    • How to use Uniconta Plugin
    • Develop a user plugin
    • Business Rules – User Plugins
    • Event Handling
    • Global Script
    • How to capture menu events
    • How to open a form in Uniconta from Plugin
    • Open new content in a IContentPluginBase plugin
    • Adding plugin in a menu
    • How to add user parameter in plugin menu
    • How to create plugin with Devexpress Library
    • Synchronize Entity Support in form page
    • Develop a PageEventBase Plugin
    • Logging Exceptions on local machine
    • Create Custom Uniconta Pages From Github Code
    • Web frame integration
  • OData
    • CRUD operations in OData
    • ODATA REST API – Testing with Postman

How to capture menu events

May 24th, 2017 January 7th, 2021 2 minutes
Print Friendly, PDF & Email

There are 2 ways to capture menu events – Pre & Post.

  • Pre – runs after the menu is clicked but before its execution
  • Post – runs after the menu is clicked & executed.

Below is an example of the Plugin Code

////summary
//// The Execute method to execute on the basis of parameter passed
////summary
////Params UnicontaBaseEntity master :- To pass the master record
////Params UnicontaBaseEntity currentRow :- To pass the selceted record
////Params IEnurable<UnicontaBaseEntity> source :- To pass dataGrid datasource
////Params String Command :- pass the command
////Params String args :- pass the argument
////Returns ErrorCodes
public ErrorCodes Execute(UnicontaBaseEntity master, UnicontaBaseEntity currentRow, IEnumerable<UnicontaBaseEntity> source, string command, string args)
{
    ErrorCodes result = ErrorCodes.NoSucces;
    try
    {
        var str = command.Split('_');
        if (str[0] == "Pre" && str[1] == "EditDebtor")
        {
            MessageBox.Show(string.Format("Handled" + command));
            errorDescription = "Pre - EditDebtor: You can continue";
            result = ErrorCodes.Succes;
        }
        else if (str[0] == "Pre" && str[1] != "EditDebtor")
        {
            MessageBox.Show(string.Format("NotHandled" + command));
            errorDescription = "Pre - str: You can continue";
            result = ErrorCodes.NoSucces;
        }
        else if (str[0] == "Pre")
        {
            MessageBox.Show(string.Format("NotHandled" + command));
            errorDescription = "Pre: You can continue";
            result = ErrorCodes.NoSucces;
        }
        else if (str[0] == "Post")
        {
            MessageBox.Show(string.Format("AfterAction" + command));
            errorDescription = "Post: This is the Post Message";
            result = ErrorCodes.NoSucces;
        }
    }
    catch(Exception ex)
    {
        errorDescription = ex.Message;
    }
    return result;
}

Now you can add Pre or Post command that needs to be handled in the User Plugin.

  • Pre_ : To handle all pre actions
  • Pre_actionName: To handle specific pre action
  • Post_: To handle all post actions
  • Post_actionName: To handle specific post action

Categories: Developers Unipedia
Home » Developers Unipedia » How to capture menu events

Get in touch with us

Uniconta

  • Uniconta
  • Modules
  • Downloads
  • Free trial signup
  • Subscription Terms
  • Privacy Policy
  • System Status

PARTNER

  • Resellers
  • For Developers
  • Uniconta API key application
  • Uniconta Partner info

Info

  • News
  • Updates
  • Customer cases
  • Video
  • IT Security
  • Backup procedure – global
  • About us

Support

  • Unipedia
  • API information
  • Contacts
© Uniconta  2026

facebook linkedin youtube

  • Visit a Country Site
    • Dansk
    • Uniconta GermanyDeutsch
    • Eesti
    • Uniconta GermanyÍslenska
    • Lietuva
    • Uniconta NetherlandsNederlands
    • Norsk
    • English