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
Comments
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:
- Inside the
UserActionmethod, you can set theActionparameter to7. This tells Studio to display a dialog box with a textbox and Yes/No/Cancel buttons. - You can use the
Targetargument to provide the dialog text, and theMsgargument to set the initial text in the textbox. - After the user interacts with the dialog, their input can be processed in the
AfterUserActionmethod 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.