ClassMethod TesteQueryString() As %Status { Set tSC = $$$OK
If 'tSC Quit tSC Set tProxy = ##class(%ZEN.proxyObject).%New() Set tProxy.Discipline = $Get(%request.Data("Discipline", 1)) Set tProxy.TestCode = $Get(%request.Data("TestCode", 1))
Set %response.ContentType = "application/json" set %response.Status = 200 Do tProxy.%ToJSON()
Hi in this case I have already used a function that returns a string, with this I came to a utility very similar to the switch case of other languages Sorry for the possible inconsistency in the response, it was translated by google translator
Example:
Class Case.Teste Extends %SerialObject {
ClassMethod Teste(pReq As %Integer) { WRITE $CASE(pReq, 1:..Oi(),2:..Tchau(),: ..GOKU()) }
ClassMethod Oi() As %String { Quit "OI sou do Brasil" }
ClassMethod Tchau() As %String { Quit "Um abraço" }
ClassMethod GOKU() As %String { Quit "Oi Eu sou o GOKU" }
go to post
Class Rest.EmailSvc Extends %CSP.REST
{
XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
{
<Routes>
<Route Url="/TesteQuery/" Method="GET" Call="TesteQueryString"/>
</Routes>
}
ClassMethod TesteQueryString() As %Status
{
Set tSC = $$$OK
If 'tSC Quit tSC
Set tProxy = ##class(%ZEN.proxyObject).%New()
Set tProxy.Discipline = $Get(%request.Data("Discipline", 1))
Set tProxy.TestCode = $Get(%request.Data("TestCode", 1))
Set %response.ContentType = "application/json"
set %response.Status = 200
Do tProxy.%ToJSON()
Quit tSC
}
}
go to post
Hi
Try the function
## Class (% SYS.LDAP) .Err2String (7)
Try the function, using the return code in place of 7 below
## Class (% SYS.LDAP) .Err2String (7)
My Caché is in Portuguese
This post has been translated by Google Translate, sorry for writing errors
go to post
Hi.
Use this code in namespace %sys:
update Security.Users set FullName = 'GOKU', Comment= 'Oi eu sou o GOKU' where id = 'gsjunior'
go to post
Hi in this case I have already used a function that returns a string, with this I came to a utility very similar to the switch case of other languages Sorry for the possible inconsistency in the response, it was translated by google translator
Example:
{
ClassMethod Teste(pReq As %Integer)
{
WRITE $CASE(pReq,
1:..Oi(),2:..Tchau(),: ..GOKU())
}
ClassMethod Oi() As %String
{
Quit "OI sou do Brasil"
}
ClassMethod Tchau() As %String
{
Quit "Um abraço"
}
ClassMethod GOKU() As %String
{
Quit "Oi Eu sou o GOKU"
}
Storage Default
{
<StreamLocation>^Case.TesteS</StreamLocation>
<Type>%Library.CacheSerialState</Type>
}
}
USER>do ##Class(Case.Teste).Teste(1)
OI sou do Brasil
USER>do ##Class(Case.Teste).Teste(2)
Um abraço
USER>do ##Class(Case.Teste).Teste(3)
Oi Eu sou o GOKU
USER>