Dmitry Zasypkin · Jan 26, 2016 go to post

No, you wouldn't, - if you're inside a class you can just use $$$YES/$$$NO without adding #include or #define:

Class temp.TestTest
{

  ClassMethod test()
  {
    write $$$YES
  }
}

Dmitry Zasypkin · Jan 26, 2016 go to post

And you can use $$$YES and $$$NO inside a class without adding"#include %systemInclude" to it.

Dmitry Zasypkin · Jun 24, 2020 go to post

Hi Mark,

At first glance there seem to be the following issue with the business operation code: Correlate() method's second argument is a class name - not an object. Please take a look at the doc:

1) https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25XML.Reader#METHOD_Correlate
2) %XML.Reader usage - https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=GXML_import#GXML_import_example

Additionally it might be helpful to replace this line If $$$ISERR(status{do $System.Status.DisplayError(status)

with

    if $$$ISERR(status) quit status

- in order to bail out and report an error in case of an exception.

Regards, Dmitry

Dmitry Zasypkin · Jun 29, 2020 go to post

Given the error message, I'd guess that Penn.EDT.Messages.ODSGPStatus class is not XML enabled, i.e. it does not inherit from %XML.Adaptor.

And you'd get an empty response anyway as you never assign anything to pResponse's properties.

One more issue is that argumentless reader.Next() call doesn't seem to make any sense. Maybe you meant reader.Next(.obj).

Also your code does not assign anything to ..Status variable, so why logging it?

Regards, Dmitry

Dmitry Zasypkin · Aug 19, 2020 go to post

Hi Yone,

There is the class iscru.util.StreamUtils designed exactly for the purpose to solve problems like yours. The class contains  streamLike() method that can be called directly or from SQL. It can also be used within business rules via iscru.util.FunctionSet.

If you want to enable searching on stream properties with Like/NotLike operators in the Message Viewer, then you would need to import iscru.util.MsgFilterAssistant class as well, then give  permission to run iscru_util.FunctionSet_streamLike stored procedure to the user, and run the following command in your namespace: 

set ^EnsPortal.Settings("MessageViewer","AssistantClass") = "iscru.util.MsgFilterAssistant"

Once you've done that, you can try Like operator against stream properties in the Message Viewer.

DISCLAIMER: The classes mentioned above have not been used much in real world projects yet. However there are some unit tests in the repo.

HTH, Dmitry

Dmitry Zasypkin · Oct 5, 2020 go to post

Hi Norman, Quote() method of %Global might be what you are lookig for:

 USER>write ##class(%Global).Quote($lb("abc", """", $c(13, 10)))
$lb("abc","""",$c(13,10))