Hello @Rodolfo Moreira,

For retrieve the task ID, I wrote this : 

ClassMethod getTaskId(
    ByRef sc As %Status = {$$$OK},
    className As %String = {..%ClassName(1)}) As %String
{
    Set id = ""
    Set rs = ##class(%Library.ResultSet).%New("%SYS.Task:TaskListDetail")
    Set sc = rs.Execute()
    Quit:$$$ISERR(sc) ""
    While (rs.Next(.sc)) {
        Quit:$$$ISERR(sc)
        if (rs.Get("TaskClass")=className){
            Set id = rs.Get("ID")
            Quit
        }
    }
    Quit id
} 

Hope this help you.

Regards.

Edit : modify this code for your needs (ex : return a list of Id, namespace filter...)

Great!

There, a version with multidimensional array support until 4 subscripts level : 


ClassMethod GetPrivateProp(
   oref,
   propName,
   ByRef result As %Binary) As %String
{
   Do ##class(%Studio.General).DumpObjectExecute(.arr,.oref)
   Set key = $o(arr(propName),1,value), @propName = arr(propName)
   For  {
      Quit:(key="")||($Qs(key,0)'=propName)
      Set subscriptLevel = $Ql(key)
      If subscriptLevel=1 {
         Set @propName@($Qs(key,1))=value
      }ElseIf subscriptLevel=2 {
         Set @propName@($Qs(key,1),$Qs(key,2))=value
      }ElseIf subscriptLevel=3 {
         Set @propName@($Qs(key,1),$Qs(key,2),$Qs(key,3))=value
      }ElseIf subscriptLevel=4 {
         Set @propName@($Qs(key,1),$Qs(key,2),$Qs(key,3),$Qs(key,4))=value
      }
      Set key = $o(arr(key),1,value)
   }
   Merge result=@propName
   Kill @propName
   Quit:$Quit arr(propName) Quit
}

Hello Eduard,

For debug purpose , you can try this :

Set obj = {Your test.ABC instance}

Set res = ##class(%Studio.General).DumpObjectFunc(obj)

While res.%Next() { Write !,"Property : ",res.%Get("Name"), !," Value : ",res.%Get("Value") }

Or just perform a zw obj

Regards.

Lorenzo.

EDIT : I tested with ##class(%Studio.General).DumpObjectFunc(obj)

We can get value if "myProp" is not an object.

Hello,

We are using this procedure in order to reduce the dowtime during software update. 

In short :

  • Create a temp namespace. 
  • import and compile code.
  • stopping application.
  • switch DB code on target namespace.
  • Execute a script for data update (if needed).
  • starting application.

It work fine for Caché.

Coming soon, we will do that for production with HealthShare Health connect.

It should be work fine also for a production, but  I don't done a test yet.

If you have a translate file, don't forget import your traductions because ^CacheMsg and ^CacheMsgNames are in CODE database.

Regards.

Hello,

I think, you should simply append your own error message like that : 

Set obj = ##class(User.tApplications).%OpenId(YourTApplicationId,"4",.errors)
Set:$$$ISERR(errors) errors = $$$ADDSC(errors,$$$ERROR($$$GeneralError,$$$FormatText("%OpenId failed for User.tApplications with id %1",YourTApplicationId)))

If an error occurs, variable "errors" will contain 2 errors.

NS>d $System.Status.DecomposeStatus(error,.b)
 
NS>zw b

Your error is in the subscript b(2).

Add  #include %occStatus if you are in a routine (for macro usage).

Regards.