Does your where clause need a colon in front of pVariable ?

where COLUMNC = :pVariable

If that doesn't fix it, I suggest you first check whether the problem is caused by the &sql(...) or by the way your web page is calling your server-side method.

Remove all your code between the opening &sql( and the closing ) - incidentally, I assume you have a closing ) even though it didn't show in your post.

Make your method end with QUIT pVariable instead of returning tempVariable1.

Do you still get a Javascript error?

For a class definition you can get the timestamp of last change from the TimeChanged property of the %Dictionary.ClassDefinition instance for the class.

For a routine, the TimeStamp property of its %Library.Routine instance is what you want.

But AFAIK the associated username isn't recorded automatically. You could use the server-side source control class interface to record this kind of thing, but it relies on whatever is making the change actually collaborating with that interface.

Do you use any form of source control?

I can't reproduce what you report.

Please confirm that in the "Debugging Target" dialog the upper radiobutton is set and the adjacent input field contains this:

##class( %SourceControl.UnitTest).Test()

And if you comment out the "D $ZF(..." line in the classmethod, then recompile it, does that resolve the problem. If not, then I think this proves that the problem isn't caused by the $ZF() call.

Also to say that if you need a response urgently you should contact InterSystems Support, a.k.a. WRC. This forum (Developer Community) is not a substitute for WRC.