calling Method from ClassMethod
This is the problem. A Method needs to be called in the context of an instantiated object. A ClassMethod by definition isn't associated with an instantiated object.
If it's necessary to do it this way, your ClassMethod could use %New() to instantiate an object and then call the Method on that object:
set myObj = ##class(My.Object.Class).%New() set tSC=myObj.myMethod()
But, it looks like you're working with a Business Service class. For that, it isn't enough to simply use %New(). You need to use Ens.Director::CreateBusinessService to instantiate the object before calling the Method.
https://docs.intersystems.com/irisforhealth20212/csp/docbook/DocBook.UI…
- Log in to post comments