I know this isn't helpful but it knocks one solution OFF the list.  I thought you could use Outputs in your method signature but this isn't supported with Python methods:

While passing arguments by reference is a feature of ObjectScript methods, there is no equivalent way to pass arguments by reference to a method written in Python. The ByRef and Output keywords in the signature of an ObjectScript method are conventions used to indicate to the user that the method expects that an argument is to be passed by reference. In fact, ByRef and Output have no actual function and are ignored by the compiler. Adding ByRef or Output to the signature of a method written in Python results in a compiler error.

https://docs.intersystems.com/iris20241/csp/docbook/DocBook.UI.Page.cls?...

From your example, I think you'd want to fire up the Python shell from the COS command line and import the iris package and call your function with the normal multiple return value syntax.  If you import the iris package you can then save the output to a global or pass it to another COS function that you need it for.

Keep this page bookmarked at all times and reference often, even if you think you know a command: https://docs.intersystems.com/iris20241/csp/docbook/DocBook.UI.Page.cls?...

If you can get to know all these commands intimately, you'll have a deep understand of library classes and methods and also INT and MAC code. 

Thanks, @Ron Sweeney 

Yes, I did put the token in the debugger and confirm only once scope is in the token and made sure that I copied and pasted that in the ValidateJWT() method so I didn't fat finger.  So the scope is indeed there.  My workaround is to not try to validate the scope within the library methods and just pull out the scope from the body and validate in a for loop.
 

@Alex Baumberg are you running IRIS on a Docker container or is it installed locally on your machine?  Check out this section: https://intersystems-community.github.io/vscode-objectscript/configurati...

Either way the setup should be quite the same.  Can someone confirm for client-side editing if the local source code folder needs a bind-mount to the Docker container and to to where it should be mapped? 

You might try using this to get started as another option: https://github.com/intersystems-community/objectscript-docker-template

For what it's worth, I'm a few years into this and I'm still constantly confused :)

@Gertjan Klein thanks for your help and sorry for my delayed response.

I did not realize the message body is not set if there’s an error.  This explains a lot.  I was previously doing a try/catch and trying to set the %Status error text into the StringContainter response and frustrated that it wasn’t there.  I think I’m trying to overdo what Ensemble already does for free.  I also think I need to keep a response a response and keep errors as errors and not try to combine them. 

But thank you for your method here to get the header ID.  Since as you say it's not trivial, it makes me think it's unconventional and again I'm trying to use the system in ways it wasn't really designed for.  However, it's handy to understand how this works.  Thanks for helping me think through this!

Thank you!

sortbox - If present, the Search Page displays a set of radio buttons that allows the user to choose how to sort the results.

I wouldn't have immediately thought that would solve it but it makes sense along with your explanation.

Out of curiosity, how would you override that write statement in %CSP.Lookup?  Isn't that generated code which one wouldn't want to touch?

I would like to know a little more about this.

I was just working on something where my business process put together a custom object based on a file from the record mapper.  The object is simply saved to the database so just to put a bow on it we send a request to a "FinishedOperation" business operation which doesn't do anything.  The request is sent async and the request object is the instance of the custom object was created/updated.  

This request object has a few properties that are object properties and one is XML enabled the other is not.  They both show up in the body of the message trace there's nothing in the content tab of the message trace.

How come they show up when they aren't XML enabled? What am I not understanding in terms of the difference between the body and the contents?

Thanks!

I don't think a DTL is considered a business host and thus you can't configure parameters for at DTL like you would normally for a business host (service, process, operation). It doesn't have an On{This}() method like the business hosts do and where you would set and change parameters.  What parameter are you trying to change?

I'm not sure about the aux param.  The documentation doesn't seem to encourage programming custom transformations in code, rather the visual editor is pressed.  The transform method seems to be generated from the <transform> tag in the DTL and looking at the .int code in some of my examples I don't see the param used (just set to "").  I'm sure an ensemble process calls it.  Considering it's generated code, I think it would be risky to try to fiddle with that.  Curious to know what it does.