Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

AllGroups

AllGroups( [lAlfa] ) --> aGroups

Queries the historical user-group structure.

AllGroupsAdvPL
01 · OVERVIEW

Overview

The consulted documentation covers releases 5.07 through 7.10 and returns a multidimensional group array. lAlfa selects ordering by name (.T.) or code (.F., default); it does not authorize changes. The historical structure contains names, schedules and access/printing settings. The example counts groups without logging complete records. This is a legacy reference, not proof of current-release support or equivalence to other security APIs. (TOTVS, n.d., ref. 1)

02 · SYNTAX

Syntax

AllGroups( [lAlfa] ) --> aGroups

Parameters

lAlfa
LogicalOptional

Order by name when .T.; by code when .F. (default).

Return value

Multidimensional array under the historical documentation; verify the environment layout.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function EdAllgrou()
    // Requires a compatible legacy environment and authorized session.
    Local aGroups := AllGroups(.F.)
    If ValType(aGroups) == "A"
        // Count only; do not dump access settings into logs.
        ConOut(cValToChar(Len(aGroups)))
    EndIf
Return Nil
Expected result

Proposes counting returned records in a compatible environment; no group is changed. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Do not use array positions as permanent identifiers. Group existence alone does not establish effective permission.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. AllGroups. TDN. Accessed on 2026-10-25.
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