Skip to content

LinkBrow Events in Merciglobal Cloud ERP

📘 Overview

In Merciglobal Cloud ERP, the LinkBrow feature allows any input field to be dynamically linked to a master table. This significantly streamlines data entry by displaying relevant records from the linked table as soon as the user interacts with the field.

This guide covers two powerful customization events developers can utilize:

  • Modify Search Conditions — based on runtime user input
  • Modify Base Query Conditions — set static filters at data fetch

🔍 What is LinkBrow?

LinkBrow enhances user experience by linking form fields to relevant master data. It simplifies data selection, maintains consistency, and boosts efficiency.

When a user clicks or focuses on a LinkBrow-enabled field:

  • A popup appears with values from the associated master table.
  • Filters can be dynamically applied using developer-defined logic.

⚙️ Event 1: Modify Conditions During Searching

This event lets developers customize search filters based on user input in the LinkBrow field.

🧩 Sample Function (in libfuncs.php):

function search_linkbrow_query_trn_challan_fasmast($search='') {
    $srch = '';
    $tokens = explode(' ', $search);
    foreach ($tokens as $token) {
        if ($srch !== '') { $srch .= ' OR '; }
        $srch .= "a.account LIKE '$token%' OR a.code LIKE '$token%'";
    }
    $q = "SELECT a.id, a.account, a.code, a.gstin as GST_NO, b.name as Group_, c.agent as Agent_, d.city, a.type as actype, a.street1, a.street2, a.street3, a.discper
          FROM #fasmast a
          LEFT JOIN #fasgrp b ON b.id = a.groupid
          LEFT JOIN #agent c ON c.id = a.agentid
          LEFT JOIN #city d ON d.id = a.city
          WHERE ($srch) AND IFNULL(a.active,'') != 'NO'
          ORDER BY 2 LIMIT 500";
    return $q;
}

✅ Notes:

  • Supports multiple tokens in the input.
  • Efficient matching with LIKE improves usability.
  • Always include LIMIT for performance control.

🧱 Event 2: Modify Base Query Conditions

This event sets static conditions before any search input is given, defining which records show up initially.

🧩 Sample Function (in libfuncs.php):

function linkbrow_trn_yarnreq_mst_item_cond() {
    $q = "a.type = 'YARN' ";
    return $q;
}

✅ Notes:

  • Only return the WHERE clause condition.
  • Use for default filters (e.g., only show items of type 'YARN').

💡 Best Practices

  • ✅ Use LIMIT in search queries to boost performance.
  • ✅ Sanitize user input to avoid SQL injection.
  • ✅ Join only necessary tables to enrich results efficiently.
  • ✅ Avoid SELECT *; specify required columns.

🔎 Use Cases

Use Case Event Type Description
Customer Selection Modify Conditions During Search Filter based on names or codes
Product List Filter Base Query Conditions Show only 'YARN' or 'FINISHED GOODS'
Agent Mapping Modify Conditions During Search Search agents using dynamic user input
City-specific Masters Base Query Conditions Restrict to specific city entries

📌 Summary

Event Type Function Signature Trigger Moment
Modify Search Conditions search_linkbrow_query__() On user input during search
Modify Base Query Conditions linkbrow___cond() On LinkBrow popup display

These hooks empower Merciglobal Cloud ERP developers to provide dynamic, context-aware data lookups.


For MerciGlobal Cloud ERP internal developers and consultants, mastering these LinkBrow events is key to delivering robust user experiences.

Last Updated: April 2025