#ObjectScript

0 Followers · 1.5K Posts

InterSystems ObjectScript is a scripting language to operate with data using any data model of InterSystems Data Platform (Objects, Relational, Key-Value, Document, Globals) and to develop business logic for serverside applications on InterSystems Data Platform.

Documentation.

Article Robert Cemper · Sep 22 2m read

Finishing my previous example for multiple IRIS instances, I tried
to compose a local single instance version.  The step from the external
Python app to a version using embedded Python seemed to be obvious.
This was a wrong assumption, as some Python libraries just refused installation
into my local Windows-based environment.

0
0 0
Article Eric Fortenberry · Dec 20, 2024 9m read

Your Mission

Let's pretend for a moment that you're an international action spy who's dedicated your life to keeping the people of the world safe from danger. You recieve the following mission:

Good day, Agent IRIS,

We're sorry for interrupting your vacation in the Bahamas, but we just received word from our London agent that a "time bomb" is set to detonate in a highly populated area in Los Angeles. Our sources say that the "time bomb" is set to trigger at 3:14 PM this afternoon.

Hurry, the people are counting on you!

The Problem

0
0 0
Question Jochen Roese · Sep 15

Hi,

so we introduced GIT in our workflow and we exported all files with $SYSTEM.OBJ.ExportUDL

Everything fine so far. But for some reason the export adds an extra line for classes (Routines are OK as far as I can see):

On Serverside it isn't there

The Problem is now that when we checkout a branch and a class changed we automatically compile it from the repository to a namespace that is made for the developer. E.g. DEV_001, DEV_002 and so on. 

0
0 0
Article John Murray · Dec 18, 2024 1m read

A benefit of using Doxygenerate is that Doxygen does more than just HTML output. Tweak the Doxyfile that tells Doxygen what to do and you can easily create a PDF. Our example MARINA application yielded a 524-page PDF. Here's what page 94 looks like:

You can browse the whole file here.

In the screenshot above, notice how we only get details of the superclass that is part of the app (AuditHistory). The primary superclass, %Library.SerialObject, is shown faded and with no details of what BankDetails inherits from it.

0
0 0
Article Evgeny Shvarov · Sep 3 5m read

Hi folks!

Sometimes, when designing a class method and feeding it with more and more useful features, very soon the number of parameters can reach 10 and even more.

It becomes pretty difficult for users of useful methods to remember the position of the important parameter, and it is very easy to misuse the position and transfer the wrong value to the wrong parameter.

Here is an example of such a method (I asked GPT to create a method with 20 params):

0
0 0
Article Robert Barbiaux · Sep 1 9m read

InterSystems IRIS interoperability production development involves using or writing various types of components. They include services (which handle incoming data), processes (which deal with the data flow and logic), and operations (which manage outgoing data or requests). Messages flowing through those components constantly require being adapted to consuming applications. Therefore,Data transformations are by far the most common component in interoperability productions.

0
0 0
Question Scott Roth · Aug 28

I had a need for a Filter, but did not want to recreate the wheel by creating another Data Lookup Table, so instead I created a Linked Table that points to a MS SQL Table outside of IRIS.

Once I had the Linked Table, I created a Class Method Function that would query the Linked Table and return a 1 if a result came back.

0
0 0
Question Chris Lambert · Aug 21

Hello,

I'm trying to get the Reply Action Code to work with the error message text.

I have this ACK:

MSH|^~\&|APP|FACIL|||20250821143621||ACK|CUEACK_20250821143621|P|2.4
MSA|AE||Failed to queue message

This is some of the Action Codes I've tried:

  • E*Failed to queue message=S
  • E*Failed=S
  • E*"Failed to queue message"=S
  • :E*Failed to queue message=S
  • :?E*Failed to queue message=S

It's not suspending the message however.

What am I doing wrong?

Thank you

0
0 0
Announcement David McCaldon · Aug 18

I’m pleased to announce the release of tree-sitter-objectscript, a new open-source tree-sitter grammar that brings first-class ObjectScript support to modern editors. If you caught the preview at READY ’25, you’ll be glad to know it’s now up on Github:

https://github.com/intersystems/tree-sitter-objectscript

What Does It Provide?

0
0 0
Article Vachan C Rannore · Aug 18 3m read

While starting with Intersystems IRIS or Cache, developers often encounter three core concepts: Dynamic Objects, Globals & Relational Table. Each has its role in building scalable and maintainable solutions. In this article, we'll walk through practical code examples, highlight best practices, and show how these concepts tie together. 

1. Working with Dynamic Objects:

Dynamic objects (%DynamicObject and %DynamicArray) allow developers to manipulate JSON-like structures directly in Objectscript. They are especially useful for modern applications that need to parse, transform or generate JSON.

0
0 0
Article Robbie Luman · Aug 15 8m read

Dynamic Entities (objects and arrays) in IRIS are incredibly useful in situations where you are having to transform JSON data into an Object Model for storage to the database, such as in REST API endpoints hosted within IRIS. This is because these dynamic objects and arrays can easily serve as a point of conversion from one data structure to the other.

Dynamic Objects

Dynamic Objects are very similar to the standard ObjectScript object model you get when you create a new instance of a class object, but with some key differences:

0
0 0
Question Corentin Blondeau · Jul 3

Hello
I want to get the property of a class, sorted by order in storage.

I know we can use
 

Set definition = ##class(%Dictionary.ClassDefinition).%OpenId(className)
        Set listProperty = definition.Properties
        For ii = 1:1:listProperty.Count(){
                    write listProperty.GetAt(ii).Name

But using GetAt sorts the results alphabetically.

Example :

Class Test.classExtends (%SerialObject, %XML.Adaptor, %JSON.Adaptor)
{

    Property tiers As%String;Property journal As%String;
}

listProperty.GetAt(1).Name = "journal" and listProperty.GetAt(2).Name = "tiers"

0
0 0
Article Ashok Kumar T · Jul 21 13m read

This article is a continuation of the IRIS JSON project and features additional methods and insights.

Let's continue with the instance methods

%GetTypeOf(Key)

This instance method is used to determine the JSON data type of the %DynamicObject or %DynamicArray.

It returns one of the following strings:

0
0 0
Article Timothy Leavitt · Aug 11 3m read

This great article sparked some recent private discussion, and I'd like to share some of my own thoughts from it.
The motivating concern boils down to: Why do we need coding rules or conventions at all? What happened to the wonderful era of the Renaissance artist-programmer forging their own path, prior to being supplanted by the craftsman and now (even worse) by AI?
In short, there are a few reasons why coding standards/guidelines are useful, and the Renaissance artist-programmer is not entirely gone.

0
0 0
Question Hannah Sullivan · Aug 6

I have a custom Buffer class which is designed to capture written/printed statements to the device, to be able to transform the captured text to string or stream type. I have used this in ObjectScript to capture ObjectScript write statements and return a string. I would like to try to use this with a [ Language = python ] method as follows. This class will be called by a scheduled task.

0
0 0
Question Yone Moreno Jiménez · Aug 5

Hello, how are you?

First of all thanks for your time reading this question.

We are investigating how to validate the indexes of a global. We have read:

https://docs.intersystems.com/irisforhealth20251/csp/docbook/DocBook.UI…

And:

https://docs.intersystems.com/irisforhealth20251/csp/documatic/%25CSP.D…

We want to validate the inxedes of the global titled "Ens.Util.LogD". We have executed on the ObjectScript terminal, on the desired namespace:

0
0 0
Article Harshitha · Aug 3 2m read

Working in healthcare IT as a young developer, especially on InterSystems TrakCare, you quickly realize one thing: it’s not just about HL7 messages or backend integrations. A hugepart of making TrakCare work smoothly for hospitals comes down to how it’s configured, customized, and supported on the application side.

That’s where people like me come in—techno-functional developers who understand both the tech and how it impacts actual hospital workflows.

We’re Not Just Techies (or Functional Consultants)

Our role sits right in the middle. We're the ones:

0
0 0
Article Timothy Leavitt · Jul 24 4m read

Let's start with a simple motivating question: over the past 14 days, what are my most common errors in the Application Error Log?

Answering this through the management portal or terminal is an annoying manual process - we should just be able to use SQL. Fortunately, there are a few class queries to help with this in the SYS.ApplicationError class in the %SYS namespace. You can answer the question for a single date with something like:

select"Error message",count(*)
from SYS.ApplicationError_ErrorList('CCR','12/16/2024')
groupby"Error message"orderby2desc
0
0 0
Question Stephane Devin · Jul 29

Hi, 
I have a code that copy a method to another class for analysis purpose.

I also want this method to appear first in the source code to easily use it in VSCode with the classmethod debug button and not search it in the numerous method of the modified class.
Is there a way to do such a thing?
I tried the placeAfter keyword but I can't find a way to make it really work as I want. Is their other ways to control the order of methods?

0
0 0
Article Joel Solon · Jul 29 13m read

Imagine you’re walking down the street on a nice summer’s day, and someone walks up to you and says “Hey, you work at InterSystems, right? I’ve been hearing more and more about InterSystems IRIS lately. I know IRIS has its own programing language called ObjectBook? or InstaScript? OK, I admit it, I know it’s called ObjectScript! I know IRIS also supports Python. I’m a Python developer, so that sounds great to me. But I’m also interested in ObjectScript. For example, Python and other languages support collections. Does ObjectScript support collections?”

You’d answer “Of course!”

0
0 0