Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

FWJsonDeserialize

FWJsonDeserialize(cParam, @uRet) --> lRet

Parses JSON in legacy code.

FWJsonDeserializeAdvPL
01 · OVERVIEW

Overview

Deprecated legacy function: the current page recommends JsonObject with no further maintenance. Historical documentation describes parsing into a dynamic object by reference with logical success; original class methods are not restored and numeric attribute names have limitations. This example uses constant JSON and checks success before property access. It performs neither macro evaluation nor schema validation. (Sources: refs. 1–2.)

02 · SYNTAX

Syntax

FWJsonDeserialize(cParam, @uRet) --> lRet

Parameters

cParam
CharacterRequired

Valid JSON text.

uRet
AnyRequired

Output variable by reference.

Return value

Logical; object returned by reference.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed432()
    Local oData
    // Fixed input; check success before accessing it.
    If FWJsonDeserialize('{"code":"ED01"}',@oData)
        ConOut(oData:code)
        FreeObj(oData)
    EndIf
Return Nil
Expected result

ED01 after success; code is a fixed teaching-contract key. 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. FWJsonDeserialize — aviso de depreciação e referência. TDN. Accessed on 2026-10-27.
  2. TOTVS. FWJsonDeserialize, descrição histórica do contrato. 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