Usina BRAdvPL Guide
Sign in
← All topics
ENTRY POINTUnder review

MTA103MNU

User Function MTA103MNU()

Adds custom options to the MATA103 Incoming Document aRotina menu array.

Entry pointsPurchasingIncoming documentMATA103Menu
01 · OVERVIEW

Overview

MTA103MNU runs in the MenuDef function of the Incoming Document routine while the aRotina array is being assembled. It receives no formal parameters: the customization changes the global aRotina array, usually with AAdd(), to insert new menu options. The official TDN page consulted lists Microsiga Protheus 10 and 11; confirm availability, contract and expected menu structure in the release you use.

02 · SYNTAX

Syntax

User Function MTA103MNU()

Parameters

aRotina
Array de registrosOptional

Global variable assembled by MenuDef. It receives additional menu options and is not a formal MTA103MNU parameter.

Source program
TDN referenceOptional

MATA103.PRW — Incoming Document routine.

Documented scope
Historical referenceOptional

Microsiga Protheus 10 and Microsiga Protheus 11, according to the TDN page consulted.

Return value

No return value is documented. The customization directly changes the global aRotina array.

03 · PRACTICAL EXAMPLE

Add an option to Incoming Document

#Include "TOTVS.ch"

User Function MTA103MNU()
    Local aNewOption := { ;
        "Additional inquiry", ;
        "U_InputInquiry", ;
        0, ;
        2, ;
        0, ;
        .F. ;
    }

    AAdd(aRotina, aNewOption)
Return

User Function InputInquiry()
    MsgInfo("Additional inquiry for the incoming document.", "MATA103")
Return
Expected result

While building the MATA103 menu, Protheus adds “Additional inquiry” and runs U_InputInquiry when it is selected. The numeric and logical values follow the format shown in the historical TDN documentation and must be validated in the release in use.

BEST PRACTICES
  • Add only required options and link every action to a function available in the environment.
  • Preserve standard entries and use AAdd() to append the new item.
  • Prefer creating a specific function for the new menu action and point the aRotina item to that function.
  • Check permissions, branch context, open work areas and required tables before running the new routine.
  • The item layout may vary by release and routine context; confirm every array position.
  • Retest all Incoming Document operations after installing the entry point.
COMMON PITFALLS
  • The official reference lists Protheus 10 and 11. Confirm the entry point and its contract in the current release source and documentation.
  • A misspelled action or missing function may fail only when the user selects the menu option.
  • An ambiguous menu description makes support and auditing harder, especially in heavily customized environments.
  • Replacing aRotina instead of appending an item can remove standard options.
  • Access permissions and business rules remain the responsibility of the custom routine.

Related content

REFERENCES
  1. TOTVS. MTA103MNU — Add options to the aRotina array. TDN historical documentation for Protheus 10 and 11.
  2. TOTVS. Entry points available in Incoming Document (MATA103). TDN, last change shown as Oct. 23, 2024.
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