One way to accomplish what you are describing is to use a temporary global: https://docs.intersystems.com/iris20231/csp/docbook/Doc.View.cls?KEY=GGB...

This allows you to store data in the IRISTEMP database that you can then retrieve like any other global. For example, if I were debugging a piece of code, I could write the following into the relevant Method:

SET ^CacheTempNP($INCREMENT(^CacheTempNP)) = <some debug value>

Then later ZWRITE ^CacheTempNP to see what I have logged.

(Note: In the documentation, we recommend using a global mapping to set up your own naming convention for temporary globals instead of using the ^CacheTemp prefix. While I still recommend doing that if you plan to use temporary globals in non-testing code, just using ^CacheTemp instead is fine for debugging.)

Rather than trying to assign some combination of predefined roles to accomplish what you are looking for, I would suggest defining a new role and assigning to it the privileges that you need. This documentation page has a guide on doing so: https://docs.intersystems.com/iris20241/csp/docbook/Doc.View.cls?KEY=GSA...

That being said, is there something that your users need to do that is not covered by the %EnsRole_Administrator role?

For more details on the Interoperability > Manage > Deployment Changes category, both the 'Deploy' and 'History' options are controlled by the %Ens_Deploy resource, so your users would need a role with Use on %Ens_Deploy. You can see what resources control a given item in the management portal by clicking on the whitespace next to the item and viewing the 'System Resource(s)' and 'Custom Resource' listings. For more information on resources and privileges, see this documentation: https://docs.intersystems.com/iris20241/csp/docbook/Doc.View.cls?KEY=GSA... . So, any role with %Ens_Deploy, e.g. %EnsRole_Administrator, should give you access.

I hope this helps!

The first error means that you aren't calling the method/routine correctly. See the <NOLINE> error code in this doc page: https://docs.intersystems.com/iris20231/csp/docbook/Doc.View.cls?KEY=RER... . Are you sure $$ConvertToMTime is the right name?

As for the second error: unlike most other programming languages, just calling a routine/method does not work in M/ObjectScript. Every line of code must use a command; in this case what you are looking for is the DO command: https://docs.intersystems.com/iris20231/csp/docbook/Doc.View.cls?KEY=RCO...

So, when calling a method/routine, you would write 'do ConvertToMTime(h,m,s)'

I'm not sure about TABLOCK specifically, but there are a couple other features that might help you solve this:

First, there is the LOCK TABLE statement: https://docs.intersystems.com/iris20241/csp/docbook/Doc.View.cls?KEY=RSQ...

There's also the objectscript LOCK command: https://docs.intersystems.com/iris20241/csp/docbook/Doc.View.cls?KEY=RCO...

You could use either of these to block the method while other instances of it are running and prevent the race condition. I'm not sure how efficient this method would be compared to TABLOCK, but it would fix the bug.

I hope this helps!

I'm not entirely clear on the question you are asking - if you just need to add quotes to a string, you can do so by escaping with another quotation mark. For example,

set b = """Cat""" // That's 3 quotation marks in a row on each side: one to open/close the string, two to add the quote character to the string

set c = b

w c
"Cat"

If you are asking how to display the quotes without actually adding quotes to the string, I'm not sure if that's possible - would need a more experienced dev to chime in.

I got an answer to this question internally and am reposting it here. From Daniel Bissex:

Using the MDX COUNT function is the slower of two options. We also have a provided Distinct plugin to address exactly this inefficiency:
https://docs.intersystems.com/iris20231/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&PRIVATE=1&CLASSNAME=%25DeepSee.PlugIn.Distinct

This uses our %KPI() function syntax, more detailed description of the calling options can be found here:
https://docs.intersystems.com/iris20231/csp/docbook/Doc.View.cls?KEY=D2RMDX_percentK

This reduced the runtime from ~5 minutes to about two seconds! The linked documentation is for IRIS 2023.1, but these functions are available in 2022.1 as well.