Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

MBrowse in legacy maintenance routines

MBrowse( nTop, nLeft, nBottom, nRight, cAlias, ... )

Understand the traditional browse and its SX3 and aRotina integration.

MBrowse in legacy maintenance routinesAdvPL
01 · OVERVIEW

Overview

MBrowse displays alias records using the SX3 dictionary. Documentation requires Private aRotina before the call; each option contains caption, function, reserved value and operation. Operations 1 through 6 mean search, view, add, edit, delete and special. A function name without parentheses receives alias, record and option from the framework. For worktables, consult TRB and aFixe requirements. The example restricts the menu to search and view rather than suggesting unimplemented CRUD. (Ref. 1)

02 · SYNTAX

Syntax

MBrowse( nTop, nLeft, nBottom, nRight, cAlias, ... )

Parameters

nTop, nLeft, nBottom, nRight
NumericRequired

Start and end browse coordinates; abbreviated signature, see reference for remaining arguments.

cAlias
CharacterRequired

Open alias with a compatible dictionary.

Return value

The consulted page does not establish an application return contract.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function EdMBrow()
    Local aArea := GetArea()
    Private cCadastro := "Customer inquiry"
    Private aRotina := {;
        {"Search", "AxPesqui", 0, 1},;
        {"View", "AxVisual", 0, 2};
    }
    // Requires a Protheus environment and open SA1 with valid dictionary.
    If Select("SA1") > 0
        DbSelectArea("SA1")
        MBrowse(6, 1, 22, 75, "SA1")
    EndIf
    RestArea(aArea)
Return Nil
Expected result

With SA1 available, proposes an inquiry with two options; otherwise no browse is opened. Return Nil belongs to the editorial wrapper, not a documented MBrowse return. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • A reduced menu is not access authorization. Validate permissions, visible fields and branch filters; consider FWMBrowse for new projects without assuming interchangeable contracts.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. MBROWSE. TDN. Accessed on 2026-10-24.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha