cTextoText displayed in the log window. It may contain a query, a technical message or other content used to support analysis.
AdvPL GuideShowLog( <cTexto> )Displays text in a log window, useful for visually inspecting queries, messages and support information during tests.
ShowLog is often used in AdvPL routines to present long text or diagnostic data in a log window. In practice, it is commonly applied during development and staging to view dynamically built SQL queries, variable contents or support messages. For safety and organization, restrict its use to administrative profiles and avoid showing it to final users in production.
ShowLog( <cTexto> )cTextoText displayed in the log window. It may contain a query, a technical message or other content used to support analysis.
The reference used does not document a return value for ShowLog. Use it for information display, not as part of a decision rule.
#Include "TOTVS.ch"
User Function ShowQuery()
Local cQuery := ""
cQuery := " SELECT * "
cQuery += " FROM " + RetSQLName("SBM") + " SBM "
cQuery += " WHERE BM_FILIAL = '" + FWxFilial("SBM") + "' "
cQuery += " AND SBM.D_E_L_E_T_ = ' ' "
If FWIsAdmin()
ShowLog(cQuery)
EndIf
ReturnWhen the user is an administrator, the generated query is displayed in a log window for visual checking.
#Include "TOTVS.ch"
User Function ViewQuery(cQuery)
Default cQuery := ""
If ! IsBlind() .And. ! Empty(cQuery) .And. FWIsAdmin()
If FWAlertYesNo("Do you want to view the query?", "Attention (" + FunName() + ")")
ShowLog(cQuery)
EndIf
EndIf
ReturnThe helper centralizes checks: it does not run in non-interactive mode, ignores empty text, restricts access to administrators and asks for confirmation before opening the log.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.