Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

FWJsonSerialize

FWJsonSerialize(uData, [lClassName], [lUTC]) --> cJson

Serializes legacy data as JSON.

FWJsonSerializeAdvPL
01 · OVERVIEW

Overview

Deprecated legacy function; TOTVS recommends JsonObject. It serializes AdvPL data to JSON text. Extra arguments control class names and date treatment; not every combination guarantees round-trip types. The example uses a simple integer array without dates, objects or credentials. Serialized output must exclude internal data unintended for consumers. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

FWJsonSerialize(uData, [lClassName], [lUTC]) --> cJson

Parameters

uData
AnyRequired

Data to serialize.

lClassName
LogicalOptional

Includes class name when applicable.

lUTC
LogicalOptional

Controls UTC date formatting under the page contract.

Return value

JSON text.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed433()
    // Fictional array without sensitive fields.
    ConOut(FWJsonSerialize({1,2}))
Return Nil
Expected result

JSON array equivalent to [1,2]; serialization whitespace may vary. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check context and return before integration; the example does not replace a complete routine.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. FWJsonSerialize — aviso de depreciação e referência. TDN. Accessed on 2026-10-27.
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