Question
· 3 hr ago

Source Control: Studio.Extension.Base.CheckIn showing a dialog with a single field?

In Studio, is it possible to call a dialog with a single input text field inside a custom Studio.Extension.Base.CheckIn method?

Update: The AI Bot just answered, not sure why it was at loss before I posted.

Product version: Caché 2017.1
Discussion (1)1
Log in or sign up to continue

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.