Not so much magic in it, if you already know how to read it, the content of XData is just a Stream, which can be used both ways. Just Write to it, and %Save it. And you will probably need to compile the class
Class Demo.Test
{
XData OpenAPI [ MimeType = application/json ]
{
}
ClassMethod Update()
{
set xdata = ##class(%Dictionary.XDataDefinition).IDKEYOpen($ClassName(), "OpenAPI")
do xdata.Data.Write("{}")
do xdata.%Save()
}
}
In VSCode, the content of XData will not appear after that, because it happened on the server, and VSCode will not see the changes, you'll need to export it manually
- Log in to post comments
.png)
.png)
.png)
.png)