#Tips & Tricks

0 Followers · 317 Posts

Pieces of experience in InterSystems Technology which solve some particular problem in elegant or unusual way.

Article Peter Steiwer · Nov 26, 2019 3m read

When designing a hierarchy in DeepSee, a child member must have only one parent member. In the case where a child corresponds to two parents, the results can become unreliable. In the case where two similar members exist, their keys must be changed so that they are unique. We will take a look at two examples to see when this happens and how to prevent it.

Example 1

There are a handful of states with a city named Boston. In my sample data, I have records from both Boston, MA and Boston, NY. My dimension is defined as:

1
1 903
Article Evgeny Shvarov · Feb 19, 2022 2m read

Hi developers!

As you probably noticed in IRIS 2021 the names of globals are random.

And if you create IRIS classes with DDL and want to be sure what global was created you probably would want to provide a name.

And indeed you can do it. 

Use WITH %CLASSPARAMETER DEFAULTGLOBAL='^GLobalName' in CREATE Table to make it work. Documentation. See the example below:

11
0 616
Article Evgeny Shvarov · Feb 19, 2022 2m read

Hey developers!

Sometimes we need to insert or refer to the data of classes directly in globals.

And maybe a lot of you expect that data structure of global with records is:

^Sample.Person(Id)=$listbuild("",col1,col2,...,coln).

And this article is a heads up, that this is not always true, don't expect it as granted!

1
0 418
Article Muhammad Waseem · Jan 11, 2022 2m read

In this article I will explain the usage of %SQL_Diag.Result and %SQL_Diag.Message table along with all-new LOAD DATA functionality.

It is recommended to go through LOAD DATA documentation first. 

After successful operation LOAD DATA insert one record in %SQL_Diag.Result table and details are inserted in %SQL_Diag.Message table


Below is the basic command when table is already created and source file does not contain header row. 

LOAD DATA FROM FILE 'C://TEMP/mydata.txt' 
INTO MyTable
1
0 306
Article Jose-Tomas Salvador · Nov 9, 2021 3m read

For some years I missed being able to offer, to everybody interested in ObjectScript, a tutorial more or less complete, to start with ObjectScript. Something that could help more and make things easier to those new developers that come to our technology... something intermediate, halfway between the common "Hello World!", that doesn't really get you further, and the "Advanced Training", that is unaffordable because of lack of time,etc.

7
0 774
Article Oliver Wilms · Jan 16, 2022 2m read

I participate in InterSystems Datasets Contest. I created dataset-finance and analyze-dataset-finance apps along with Online Demo.

The username is _SYSTEM and password is SYS. I created an online demo with a pretty dashboard here:

 https://finance.demo.community.intersystems.com/dsw/index.html#/login?from=%2FUSER%2FGenerated%2FSamples%20for%20finance.dashboard

 I wanted to create my own pivot table and went to regular management portal:

 https://finance.demo.community.intersystems.com/csp/sys/UtilHome.csp

 We can access Analyzer in USER namespace directly: 

0
0 205
Article Evgeny Shvarov · Jan 9, 2022 2m read

Hi folks!

Sometimes we need the docker image of the InterSystems IRIS solution we build to be published on some docker registry. The cases could be:

  1. Deploy it then in Kubernetes cluster
  2. Let your pal run the image of your public repo without building it locally.

You can push the image to Docker Hub Registry or Github Registry.

In this very short article, I provide a way how to do it automatically on every push to your GitHub repository.

0
2 337
Article Sylvain Guilbaud · Oct 6, 2016 3m read

to dismount/mount a database, use Dismount() and Mount() methods in SYS.Database class available in %SYS namespace.
NB: the database ID is its Directory

You'll find  some examples of how to dismount/mount and check if a database is mounted (Mounted=1) or not (Mounted=0), and quickly see all the attributes of a database (via zwrite)

2
1 2831
Article David Hockenbroch · Nov 12, 2021 7m read

Pouring The Coffee: Creating and scheduling a task

Don't you wish a fresh, hot cup of coffee could be waiting for you right when you get into the office? Let's automate that!

Cache and IRIS come with a built-in Task Manager, which should have a familiar feel to those used to using the Windows task scheduler or using cron on Linux. Your user account will need access to the %Admin_Task resource to use it, and you can access it in the management portal under System Operation -> Task Manager. When first installed, there are roughly 20 types of task that you can schedule.

7
4 1653
Article Jean Millette · Nov 5, 2021 2m read

One of our apps uses a class query to support a ZEN Report and works just fine in that report, producing the expected results every time. We’ve since migrated to InterSystems Reports and noticed that, for a report using the same class query, 100s of extra rows with the same column values appear at its bottom.

We eliminated InterSystems Reports as the source of the problem by recreating the same “extra rows” issue with an Excel spreadsheet calling the same class query as a stored procedure.

0
0 346
Article Evgeny Shvarov · Aug 5, 2021 1m read

Hi folks!

Want to share a lifehack with you on ObjectScript highlighiting withing VSCode for script files.

Script files are just files with lines of ObjectScript that we feed anywhere, e.g. into IRIS during Docker baking procedure.

Typical usecase - here is the Scriptfile

here is the Dockerfile where we feed it.

And here is how it looks like usually in VSCode:

Coudl be more beautiful, right?

0
0 529
Article Jose-Tomas Salvador · Apr 8, 2020 6m read

This time I want to talk about something not specific to InterSystems IRIS, but that I think is important if you want to work with Docker and your server at work is a PC or laptop with Windows 10 Pro or Enterprise.

11
3 29688
Article Robert Cemper · Mar 27, 2021 3m read

Testing ECP-based applications often take quite some effort for setup and preparation.
I have created a Docker-based workbench that allows you to have it quick at hands.
And if you crash it? You just give your containers a fresh start.
The whole setup runs code-based during the start-up of your instance.
In that sense, it is also a portable coding example using ZPM and the objectscript-docker-template

 see Video

3
0 611
Article Tani Frankel · Apr 7, 2021 1m read

In Studio you could open a class directly via it's name, without having to traverse the package tree with multiple clicks until arriving at the desired class.

You would Ctrl + O or (File -> Open) and be able to simply type in the class name, for example:

You press Enter, and viola - the class is opened.

How do you achieve this in VSCode?

1
0 708
Article Evgeny Shvarov · Jan 27, 2021 1m read

Hi folks!

Just a very short note on if you want to add a cute Open Exchange shield like this:

 in your GitHub repo you can do it by entering one line like this:

[![Gitter](https://img.shields.io/badge/Available%20on-Intersystems%20Open%20Exchange-00b2a9.svg)](https://openexchange.intersystems.com/package/csvgen)

In the URL place the path to your OEX page.

Thanks to the participants of contest for such a neat shield )

What other helpful Github shields do you know? Please share in the comments?

0
0 395
Article Igor Titarenko · Sep 10, 2020 3m read

One of the leading benefits of ObjectScript is the speed and efficiency it allows for an experienced developer. Let's look at an example of how you can benefit from ObjectScript today.

Suppose you have a class that stores the names of your users. We'll call the class Data.User, and give it a string property Name. Next, we will need a method to create a new user or update an existing one. A naive, simplistic approach might look like this example:

10
0 726
Article Robert Cemper · Oct 9, 2018 3m read

*** archived ***

The question has come up several times and I saw mixed answers and no quick example

My personal preference is using CPIPE device as you get back exactly the output you will get at the command line interface of your OS .
The tricky thing is to stop reading in time.
The example just displays what you normally see in your console.
it becomes useful if you look for things that you can't get from any $system.whatever()

e.g.
- your servers IP address or addresses depending on your configuration.  
- pinging any other server to see if it is still visible on the network
- running nslookup 

5
4 2543
Discussion Dmitry Maslennikov · Nov 9, 2020

Let's imagine you have to implement a method with a definition

/// Set value to %session.Data
ClassMethod setValue(params...) As %Status
{
}

How it should work

do ..setValue("key1", "val")

is equal to

set %session.Data("key1") = "val"

and 

do ..setValue("key1", "key2", "key3", "key4", "val")

is equal to 

set %session.Data("key1", "key2", "key3", "key4") = "val"

so, quite simple, any amount of arguments, while the latest one is a value, and any previous is an index, should accept at least 2 arguments.

How would you implement this method?

15
0 330
Article Henrique Dias · Aug 26, 2020 3m read

Hi Community, 

I shared my experience working with FHIR for the first time in this article.

In that article, I wrote how I explored the FHIR Resources and talked about the information that I found useful in FHIR documentation.

The first version of my app only shows the information that FHIR Resource provides. 

I wanted to make the user able to update the patient details, so I to search for an example of how to do it. 

The Github page of fhir.js has an example of how to update a resource. 

Looking at this example made me think that it was effortless. 

2
0 1165