I don't know if this can help, but in objectscript the command to extract some elements from a list is the following: 

SELECT * FROM <tableName> WHERE FOR SOME %ELEMENT (<listName>) (%VALUE = '<value>')

For example, if you have a persistent class like this: 

Class User.SQLtable Extends %Persistent
{
    Property propertyList As list Of %String(MAXLEN = 100) [ Required ];
    Index ListIdx On List(ELEMENTS);
}

You can extract information using: 
SELECT * FROM User.SQLtable WHERE FOR SOME %ELEMENT (propertyList) (%VALUE = '67')

In this way you can retrieve the row that contains the specific data value of interest with dynamic or static SQL and subsequently extract the list as a property of the SQL result object

Hi Enrico,

Thank you for the response. I've tried both adding an OnFailureTimeout method in my custom BO and directly modifying the OnFailureTimeout method inside the Ens.BusinessOperation. However, in the first case, nothing happens, while in the second case, the error "ERROR #5883: Item 'Ens.BusinessOperation' is mapped from a database that you do not have write permission on" occurs

 

Hi Ashok,

Thank you for your response. As I said to Ian, maybe I expressed wrong and I apologize for any confusion, but I did not intend to start a new line within the log that is printed in the Visual Trace. Instead, I wanted to start a new line within VSC in order to avoid writing long one-line logs in the visual interface of VSC.

For example, I am looking for a way to transform this line of code:

$$$LOGINFO("this is the first line "_$c(13,10)_"this is second line"_$c(13,10)_" this is third line")

 Into something like that, to improve code readability: 

$$$LOGINFO("this is the first line "
            _$c(13,10)_"this is second line"
            _$c(13,10)_" this is third line")

Hi Ian,

Thank you for your response. Maybe I expressed wrong and I apologize for any confusion, but I did not intend to start a new line within the log that is printed in the Visual Trace. Instead, I wanted to start a new line within VSC in order to avoid writing long one-line logs in the visual interface of VSC.

For example, I am looking for a way to transform this line of code:

$$$LOGINFO("this is the first line "_$c(13,10)_"this is second line"_$c(13,10)_" this is third line")

 Into something like that, to improve code readability: 

$$$LOGINFO("this is the first line "
            _$c(13,10)_"this is second line"
            _$c(13,10)_" this is third line")

No, I don't have any HTML-type formatting. This is the message displayed through the trace: 

object: 'No response or error was received in reply to the previous message, attempting to resend the message.',
retryCount: '3'
ResponseTimeout: '5'

To display this message in the visual trace, I used the following code:

$$$TRACE("object: 'No response or error was received in reply to the previous message, attempting to resend the message.', "_$CHAR(10)_"retryCount: '"_..RetryCount_"'"_$CHAR(10)_"ResponseTimeout: '"_httpRequest.Timeout_"'")

I used $CHAR(10) to insert a new line since the $$$TRACE command isn't affected by syntax like "\n." 

Hi Pravin, 

You can use the syntax ./folderName in the files to include camp from the Search panel. 

Example

This is my workspace

I have 3 folders: 2 on a remote server and one in local.

If I would like to restrict the research only to a remote folder I can type: ./npri_server_fhir:OMR

As shown in the following picture:

Make sure you have followed the procedure outlined at this page (InterSystems ObjectScript extension for VS Code), under Enable proposed APIs, to enable the search across all folders.

Thank you Luis, this was useful. 

However, I've encountered two issues while adapting the code you provided to my specific situation:

if ..RetryCount = 1 {
    ; Find the production
    #dim p As Ens.Config.Production
    Set p = ##class(Ens.Config.Production).%OpenId("ProductionName")
    if '$isObject(p) {
        $$$LOGERROR("Production not found")
        quit
    }
    #dim item As Ens.Config.Item
    #dim sett As Ens.Config.Setting
    ; Loop over all the elements of the production 
    for i=1:1:p.Items.Count() {
        s item=p.Items.GetAt(i)
        ; Find the desired business component
        if (item.Name="Component1Name"
            ||(item.Name="Component2Name"))
            {
            $$$LOGINFO(item.Name_" found")
            ; Explore settings
            for s=1:1:item.Settings.Count() {
                set sett=item.Settings.GetAt(s)
                ; Search for the FailureTimeout
                if (sett.Name="FailureTimeout"){
                    $$$LOGINFO(sett.Name_" found")
                    ; Change the valure of the FailureTimeout based on the Severity
                    If Severity = "high" {
                        set sett.Value = -1
                    } Else {
                        set sett.Value = 30
                    }
                } 
            }
        }
    } 
    Set sc = p.%Save()
    If $$$ISERR(sc) { 
        $$$LOGERROR($System.Status.GetErrorText(sc))
        quit
    } 
}

With this code, I can adjust the FailureTimeout value based on the Severity parameter, and the updated value is correctly shown in the Production settings. Nevertheless, there are a couple of issues:

  1. This functionality only applies to modified settings, as it doesn't affect settings with default values, which are not included in the loop (set sett=item.Settings.GetAt(s)). Consequently, it's necessary to modify the settings at least once to ensure they are processed within the loop.
  2. While the FailureTimeout value gets updated, the sending procedure uses this updated value for the subsequent message, not the current one. As a consequence, the current message continues to operate with the outdated FailureTimeout value, causing the sending (and re-sending) procedure to deviate from the desired timeouts. 

Hi Rich, sorry for the late response but I've worked on other projects for some times.

I believe the issue with my code lies in the fact that the POST request was sent via a %Net.HttpRequest object:

// Send an HTTP POST request
Set messageStatus = httpRequest.Post(operation)

rather than using directly the adapter: 

set tsc = ..Adapter.PostURL(URL,.tResponse,,InputStream)

so the Timeout property of the %Net.HttpRequest object wasn't affected by the change on Response Timeout.

I solved this issue with a little help of @Menno Voerman's suggestion:

Set tHttpRequest.WriteTimeout = ..Adapter.WriteTimeout
Set tHttpRequest.Timeout = ..Adapter.ResponseTimeout
Set tHttpRequest.OpenTimeout = ..Adapter.ConnectTimeout  

In this way is possible to modify the response timeout dinamically too. 

I'm not sure if switching to the Adapter.PostURL method is a better choice compared to using httpRequest.Post. For now, I'm using the latter to minimize changes in my code.

To conclude this discussion, I've summarized the solutions that have been suggested:

  1. For Visual Studio Code (VSC) Users with IRIS 2020.1.1 or IRIS 2021.1.2: Users that have IRIS 2020.1.1 or IRIS 2021.1.2 and that are able to install external extensions, might find useful the Web Terminal extension for VSC. This extension enables to launch a web-based terminal directly from VSC. 
  2. For VSC Users with IRIS 2023.2: As suggested by @John Murray in a previous response, users of IRIS 2023.2 can take advantage of the new "WebSocket Terminal" feature included in the latest version of the VSC extensions and they don’t need for additional workarounds.
  3. For VSC Users with Docker-based IRIS: Those working with IRIS environments within Docker and using VSC can start a terminal session directly within the Docker environment, as suggested by @Evgeny Shvarov.  

Additionally, I've come across a few more solutions:

  1. For VSC users with IRIS Versions Prior to 2023.2 working on their local machine: In this case it’s possible to set up a dedicated IRIS terminal within VSC:
    1. Open the settings.json file.
    2. Add the following code under "terminal.integrated.profiles.windows":
"IRIS Terminal": {
    "path": [
        "C:\\InterSystems\\IRISHealth\\bin\\irissession.exe"
    ],
    "args": ["IRISHEALTH"],
    "icon": "terminal-cmd"
}

Note: Select the right path of irissession.exe.

c. Navigate to: Terminal > New Terminal > Launch Profile… > IRIS Terminal.

  1. For VSC Users Coding on IRIS based on a remote server using an SSH connection: For those who code on a remote server (e.g., a company server) accessible via SSH connection (e.g., using Putty) it is possible to use the Remote - SSH VSC extension to connect directly to the server. In order to do so:
    1. Install the Remote - SSH: Editing Configuration Files extension on VSC;
    2. Click on the “Remote Explorer icon in the sidebar;
    3. Select “Open Configuration Fileto open the “ssh_configfile.
    4. Insert the following code into the configuration file: 
Host my-putty-connection
    HostName < IP address or server name >
    User < username >
    IdentityFile < private key path on your local machine >
    Port < port >
    1. Save the file. After a few seconds the new connection should appear in the Remote Explorer panel;
    2. Click “Connect in New Window
    3. In the new window, navigato to: Terminal > New Terminal. You’re now connected to the remote machine and can use its IRIS terminal within VSC.