Thank you, @Herman Slagman
This is how I'm tackling it now - setting it after importing data and using $I(myclassD) after.
- Log in to post comments
Thank you, @Herman Slagman
This is how I'm tackling it now - setting it after importing data and using $I(myclassD) after.
THat's good to know, thank you @Robert Cemper !
Thank you @Matjaz Murko , @Robert Cemper , @Vitaliy Serdtsev @Herman Slagman .
Of course, I'd love to let IRIS maintain IDs.
But I don't see if it is possible at all if I need to export data into csv that is connected to each other e.g. via IDs.
I've created an example app of a "SuperSystems Enterprise" software company, that produces software products of different kinds, and there are companies that exist and buy these products from time to time.
So there are 3 entities in such a given system: products, companies, and sales. And sales entity contains IDs of companies and products they purchased along with date and sum.
Here is the code - if you build it in docker it will load the data from 3 csv files in /data folder: companies.csv, products.csv and sales.csv into related classes.
Notice that companies.cls and products.cls in this case maintain their own ID not an IRIS one as I don't know the other way it can be performed in IRIS so that data on sales connecting products and companies can be imported accurately to the history before reflected in csv. Other than way I chose here.
I suggest anyone who is interested in an exercise to fork the project and change the iris classes structure, or IDs, or ways of loading data, so that still the history of sales will be accurate - in order to check it easie,r I've provided a unittest that will check the sums of sales for 103 and 104 companies as :
USER>zpm
ipm:USER>test dc-onetomany-case
What do you think? )
Id location is in place - and has Ids in the first index, like ^myclassD(1),^myclassD(2), etc.
But nothing is set in ^myclassD
Other parameters I have:
Property id As %Library.BigInt [ SqlColumnNumber = 14 ];
Parameter ALLOWIDENTITYINSERT = 1;
Index MYCLASSPKEY1 On id [ IdKey, PrimaryKey, SqlName = MYCLASSPKEY1, Unique ];
And I import IDs from the csv file.
so my
set newid=$I(newid)
part uses $Increment
Yes, $I is the short of $Increment.
But from which global?
$Seq is a faster option of $Increment
Hi @Daniel Kutac ! Have you tried this OEX app by @Guillaume Rongier ?
Works like a charm, impressed.
Thank you, @Tani Frankel! Will take a look
Wow. Thank you, AI
Wow. ObjectScript is like an endless book of surprises :) You never know what you can find the next day :)
Don't know if I ever used something like this. For me, #dim can be useful to easily suggest a possible method or property while coding, but good to know about such an option!
Thank you @Vitaliy Serdtsev !
Thanks @Robert Cemper !
I this case Query was a slightly better alternative to me vs Embedded SQL (more readable SQL). So…
But knowing once again that everything is possible is always good, especially a few days before New Year! :)
Thanks for the clarification, @Ashok Kumar Thangavel !
What can I say - it's not obvious (that it is only for SELECT), and it's a pity as the "Query" functionality that works great for SELECT can also be leveraged with INSERT, DELETE and UPDATE.
Sounds like a good candidate for the Ideas portal :)
#DIM is just a hint for VSCode ObjectScript code completion and also a hint for a developer "what this thing is about". Compiler skips #dim lines.
thank you @Ashok Kumar Thangavel @David Hockenbroch both!
Included your code into the new embedded python template release - here.
Very cool, @David Hockenbroch ! This is what I'm getting in my case:

Found one option!
ClassMethod DivideByZeroPython() [ Language = python ]
{
import sample
import iris
try:
print("divide by zero=" + str(sample.dividezero(1)))
except ZeroDivisionError as e:
errobj=iris.cls("%Exception.General")._New(str(e),42)
a=errobj.Log()
print("Caught exception: " + str(e))
}This stores the error in Apps Log, but no stack (of course):

Any ideas how I can store at least the class and line of code in parameters? I can provide the name and location to %Exception.General class that will be stored in the App Log.
Thank you, Mike! will give it a try!
Thanks, @John Murray ! Do you have any examples connecting both locally and remote?
I'd appreciate any example of a ready-made .code-workspace file, thank you in advance!
Interesting! Do you want to share an example of .code-workspace files and how to switch between servers?
Yes.
It maybe a different thing: the format with <Export generator> is outdated and Studio together with LoadDir both support the outdated format and don't support the "new" one without the <Export> element, which is in Atelier API that VSCode is using (why do we still use this Atelier name? )
So, I'd better ask to support the new format, as the Export tag thing also has an annoying "feature" that it incudes date/time of export and this changes the file with every save/export even there were no changes.
Hi Team!
Installed the extension in VSCode, installed classes via IPM zpm "install iris-oas-test-gen".
Opened Swagger 2.0 spec file, clicked generate, and see the following:

Looks like a connection error. I have VSCode connected to IRIS - it's in a docker contaner.
Any hints how to make the extension see working IRIS?
The only "caveat" of the approach is that you should put all of the pivots and dashboards into one big class container. Even you have 100+ of them.
It's like, "let's put all the classes into one big XML and store it in the repo in one file". It's OK for import/export, but not ideal for source control.
Thank you, @Dmitrij Vladimirov
Sounds like that.
Actually, I tried with another proejct and failed going with PKG approach, as DFI are being exported in a shorter form for me, .e.g.:
<?xml version="1.0"?>
<dashboard xmlns="http://www.intersystems.com/deepsee/library" name="AnnualPotatos" folderName="" title="Annual Potato Analytics" description="" keywords="" owner="" shared="true" public="true" locked="false" resource="" timeCreated="2025-08-26T23:29:13.2Z" createdBy="SuperUser" category="" bookCover="" scheme="" worklistCount="2" snapTo="true" snapGrid="true" gridRows="10" gridCols="10" canResize="true" canModify="true" showTitleBar="true" titleBarOpacity="" titleBarColor="" selectedTitleBarOpacity="" selectedTitleBarColor="" titleBarTextColor="" selectedTitleBarTextColor="" titleBarFont="" companyName="" companyLogo="" companyStyle="" backgroundColor="white" backgroundImage="none" backgroundRepeat="no-repeat" backgroundSize="100% 100%" backgroundOpacity="1" widgetBorders="1px solid #F0F0F0" widgetBordersSwitch="edit" widgetBordersColor="#F0F0F0" widgetBordersStyle="solid" widgetBordersWidth="1" widgetBordersToggle="true">
<widget name="Widget2" type="pivot" subtype="comboChart" subtypeClass="comboChart" title="Potato Sales and Import, Tonnes" dataSource="Potatos/Yearly.pivot" dataLink="" drillDownDataSource="" width="200" height="200" sidebarContent="" showSidebar="false" sidebarWidth="" maximized="false" homeRowL="0" homeColL="0" colSpanL="7" rowSpanL="7" showToolbar="true" showToolbarBottomBorder="true" showToolbarOnlyWhenMaximized="false" colorToolbar="#F0F0F0" opacityToolbar="1" backgroundColor="#F0F0F0" opacity="1" theme="" dataColorList="">
<control name="" action="applyFilter" target="" targetProperty="[Country].[H1].[Country]" location="widget" type="auto" controlClass="" label="Country" title="" value="" text="" readOnly="false" valueList="" displayList="" activeWhen="">
<valueRequired>false</valueRequired>
</control>
<override name="comboChart">{legendVisible:'false',xAxis:{_type:'axis'},yAxisList:[{_type:'axis'}],seriesTypes:',bar',_type:'comboChart'}</override>
</widget>
</dashboard>In your case there is also an export tag:
<?xml version="1.0"?>
<Export generator="IRIS" version="26" zv="IRIS for Windows (x86-64) 2024.3 (Build 217U)" ts="2025-09-21 16:49:04">
<dashboard xmlns="http://www.intersystems.com/deepsee/library" name="AnnualPotatos" folderName="Potatos" title="Annual Potato Analytics" description="" keywords="" owner="" shared="true" public="true" locked="false" resource="" timeCreated="2025-08-26T23:29:13.2Z" createdBy="SuperUser" category="" bookCover="" scheme="" worklistCount="2" snapTo="true" snapGrid="true" gridRows="10" gridCols="10" canResize="true" canModify="true" showTitleBar="true" titleBarOpacity="" titleBarColor="" selectedTitleBarOpacity="" selectedTitleBarColor="" titleBarTextColor="" selectedTitleBarTextColor="" titleBarFont="" companyName="" companyLogo="" companyStyle="" backgroundColor="white" backgroundImage="none" backgroundRepeat="no-repeat" backgroundSize="100% 100%" backgroundOpacity="1" widgetBorders="1px solid #F0F0F0" widgetBordersSwitch="edit" widgetBordersColor="#F0F0F0" widgetBordersStyle="solid" widgetBordersWidth="1" widgetBordersToggle="true">
<widget name="Widget2" type="pivot" subtype="comboChart" subtypeClass="comboChart" title="Potato Sales and Import, Tonnes" dataSource="Potatos/Yearly.pivot" dataLink="" drillDownDataSource="" width="200" height="200" sidebarContent="" showSidebar="false" sidebarWidth="" maximized="false" homeRowL="0" homeColL="0" colSpanL="7" rowSpanL="7" showToolbar="true" showToolbarBottomBorder="true" showToolbarOnlyWhenMaximized="false" colorToolbar="#F0F0F0" opacityToolbar="1" backgroundColor="#F0F0F0" opacity="1" theme="" dataColorList="">
<control name="" action="applyFilter" target="" targetProperty="[Country].[H1].[Country]" location="widget" type="auto" controlClass="" label="Country" title="" value="" text="" readOnly="false" valueList="" displayList="" activeWhen="">
<valueRequired>false</valueRequired>
</control>
<override name="comboChart">{legendVisible:'false',xAxis:{_type:'axis'},yAxisList:[{_type:'axis'}],seriesTypes:',bar',_type:'comboChart'}</override>
</widget>
</dashboard></Export>And zpm load imports the latter one, but not the first type.
Also, if I save it in VSCode, it removes <export> tag as a result of compiling. But the same doesn't let it be imported via PKG approach.
I think what've found is a "hack", or side-effect. Because of ZX.PKG resource line IPM imports "everything" from /src/ZX folder, inlcuding dfi files which happen to be there.
But it's OK. I wonder, if there will be no classes in ZX, or if you include another folder ZY which include only DFI documents inside, will IPM import those as well?