User bio
404 bio not found
Member since Aug 19, 2020
Replies:

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.

Certifications & Credly badges:
Anna has no Certifications & Credly badges yet.
Global Masters badges:
Anna has no Global Masters badges yet.
Followers:
Anna has no followers yet.
Following: