Usina BRAdvPL Guide
Sign in
← All topics
FOUNDATIONPublished

Microsiga Protheus SDK

AdvPL · linguagem, dados, interface e integração

Overview of the Protheus SDK and the main foundations covered by its documentation.

SDKAdvPLProtheusFoundations
01 · OVERVIEW

Overview

The Microsiga Protheus SDK brings together concepts and references for developing, maintaining and integrating AdvPL solutions. The documentation introduces the language, variable types and scopes, arrays, code blocks, operators, and paths to commands, functions, customizations, MVC and best practices.

02 · SYNTAX

Syntax

AdvPL · linguagem, dados, interface e integração
03 · PRACTICAL EXAMPLE

Explicit field access

User Function ExSDK()
    Local cName := "Customer"

    DbSelectArea("SA1")
    cName := SA1->A1_NOME

    ConOut(cName)
Return
Expected result

The explicit alias identifies the work area from which the field is read and reduces ambiguity during maintenance.

04 · PRACTICAL EXAMPLE

Variables with clear scope and prefixes

User Function ExVariables()
    Local cName := "Customer"
    Local nQuantity := 10
    Local lActive := .T.

    If lActive
        ConOut(cName + ": " + CValToChar(nQuantity))
    EndIf
Return
Expected result

Local and the c, n and l prefixes make each variable’s scope and expected type easier to recognize.

BEST PRACTICES
  • The material was designed for developers, partners and customers who customize or integrate Protheus.
  • AdvPL can work with data, business rules, screens, reports, web services and email communication, according to the resources available in the environment.
  • This page is an entry point: developed subjects link to their own pages, while the others remain marked as “Coming soon” in the catalog.
COMMON PITFALLS
  • The consulted reference dates from 2014; tool, product and feature names must be contextualized and checked against current TOTVS documentation.
  • Historical limits, database or platform lists, and configuration recommendations may have changed between releases.
  • The SDK describes platform capabilities, but it does not replace validating code and include files in the release being used.

Related content

REFERENCES
  1. TOTVS. Microsiga Protheus SDK. Version 1.0, July 31, 2014. Author: Marcos Cesar Pires Gomes; reviewers: Eduardo Perusso Riera and Ivan Pinheiro Cabral.
  2. TOTVS. AdvPL using MVC. Supplied 134-page PDF, generated June 1, 2018; related content reviewed August 2, 2026.
Status
Published
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR