From AI:

Yes, it is possible to call a dialog with a single input text field in the UserAction method in a class that extends %Studio.Extension.Base. Here’s how it works:

  1. Inside the UserAction method, you can set the Action parameter to 7. This tells Studio to display a dialog box with a textbox and Yes/No/Cancel buttons.
  2. You can use the Target argument to provide the dialog text, and the Msg argument to set the initial text in the textbox.
  3. After the user interacts with the dialog, their input can be processed in the AfterUserAction method 1.

For example:

Method UserAction(Type As %Integer, Name As %String, InternalName As %String, SelectedText As %String, ByRef Action As %String, ByRef Target As %String, ByRef Msg As %String, ByRef Reload As %Boolean) As %Status
{
    If Name="SourceControl,DialogWithTextField" {
        Set Action = 7
        Set Target = "Enter your input:"
        Set Msg = "Default Text"
    }
    Quit $$$OK
}

In the AfterUserAction method, you can handle the user’s response:

Method AfterUserAction(Type As %Integer, Name As %String, InternalName As %String, Answer As %Integer, Msg As %String, ByRef Reload As %Boolean) As %Status
{
    If Answer = 1 {
        Write !, "User entered:", Msg
    }
    Quit $$$OK
}

Ensure that this class is registered as the source control class for the namespace if required 1.

Thanks, Robert. It is available in 2017, but I was not able to set it up yet. Something is still wrong the way I run it, please see below. I start debugging, stop at a breakpoint and input the $J value.

%SYS>D DIR^TRACE()
 
%SYS>D ^TRACE
 
TRACE utility for Cache. You can signal a process to write a record of all
procedure, function, or subroutine calls to a file. Then use this utility to
interpret and display the trace. The trace file is named: CacheTrace_'pid'.txt
 
Use $$DIR^TRACE(dir) to set the directory where the file(s) should be written
(process must have create/write access to the directory). $$DIR^TRACE() returns
the current directory for trace files.
 
Use $$ON^TRACE(pid) to start the trace and $$OFF^TRACE(pid) to end the
recording. Then just run ^TRACE to see the results.
 
Process ID for trace file: 5352
Output to: <0> TestAG.txt
 
Processing file ...
 
-1,Unable to open file CacheTrace_5352.txt
%SYS>

I did not try it myself, but I talked to other people and searched more, and it seems that using VS Code (as opposed to Iris/Cache Studio) combined with Copilot is currently the best available way of incorporating AI into ObjectScript/MUMPS coding: Coding InterSystems ObjectScript with AI Copilot. @Evgeny Shvarov, would you agree? Would you like to add anything on the discussion subject?