Question
Evgenii Ermolaev · Nov 2

Receiveing <UNDEFINED> error for a variable that is not referenced in the line in the error?

I am receiving the following error in my buisness operation:

ERROR <Ens>ErrException: <UNDEFINED>zGo2+181^mb.MbMainOperation.1 *tSC -- - registered as '-' number - @' set pResponse = ##class(mb.MbMessageResponse).%New()'

From what I understand, the problem occurs in the generated int file mb.MbMainOperation.1 in the method zGo2, with the offset of 181 lines, and the variable in question is a local variable tSC.

However, the line where the error occurs does not refer to tSC in any way

set pResponse = ##class(mb.MbMessageResponse).%New()

I even went as far as to set the variable at the very start of the method, but the error does not go away.

What am I missing?

Product version: Ensemble 2018.1
00
3 0 3 81
Log in or sign up to continue
As I can understand, I see that this is a variable of a class response.
Did you instantiate the variable before calling your method?

Could you please paste in the compiled code for zGo+181^mb.MbMainOperation.1 and the code preceding it?

I wonder if the business host is running an old version of the class. (That would explain why the <UNDEFINED> reports a weird line of code, and why the error hasn't gone away after you fixed it.) Maybe try disabling + reenabling the business operation / restarting the production?