David Hockenbroch · Sep 6, 2023 go to post

As for telling whether it's a production or test system, you might want to consider $SYSTEM.Version.SystemMode(). Calling that function with no argument will return the current system mode, which can be DEVELOPMENT, LIVE, TEST, or FAILOVER. It's usually set in the System Management Portal, but you can also call that function passing any of those strings are an argument to set it programmatically.

David Hockenbroch · Aug 31, 2023 go to post

Assuming that's a typo and the last one is supposed to be Class BZ.Test3, this is all correct and as expected. Since it extends Test2, Test3's onloadHandler function is identical to Test2's onloadHandler, which runs its superclass's onloadHandler and prints test2. Since its superclass is Test2, it's superclass's onloadHandler is also running its onloadHandler, then printing test2. Since Test2's superclass is Test1, Test2 is running its superclass's onloadHandler, printing test1.

Remember, removing the onloadHandler method from Test3 doesn't mean that it doesn't have an onloadHandler; it just means its onloadHandler is the same as the one in its superclass, Test2.

David Hockenbroch · Aug 31, 2023 go to post

Have you checked the timeout on the web application?

See this FAQ and look for the question "I closed my CSP session, but Caché still reports that I am using a license. Why?" I don't know much about your specific application, but that may be what you're running into. CSP sessions have a grace period that, frankly, doesn't make much sense at all. That FAQ explains how long the CSP session grace period lasts, and the question after that is about how to set the timeout for your web applications. Doing so appropriately will minimize the grace period.

David Hockenbroch · Aug 29, 2023 go to post

FYI, the reason this is so difficult is because an XLSX file is actually a ZIP archive with a bunch of XML files in it. You'd actually have to save the file as a .ZIP, extract it, navigate to the XML files for the worksheets (on the current version, that's inside the archive in \xl\worksheets, but that's changed between versions if I remember correctly) then parse the data out of the XML file and write it to your CSV file. That's why there are all these third-party tools people are recommending to handle this issue.

David Hockenbroch · Aug 4, 2023 go to post

What was the query you were trying to run? This looks like an issue with the way the query was written.

David Hockenbroch · Aug 4, 2023 go to post

This, or if SecondMethod returns a value of some sort, you'd want to:

Method "this_MainMethod"()
{
    set somevalue = ..SecondMethod()
}

Method SecondMethod()
{
    // ...
}
David Hockenbroch · Aug 2, 2023 go to post

Just out of curiosity, what's the wireless charging mouse pad? All of the other prizes have a specific brand and model listed, but not that one.

David Hockenbroch · Aug 1, 2023 go to post

I'll second this! I'm not an Apple person either. I really like my Samsung Galaxy watch. For Android users, that may be a good alternative to an Apple watch.

David Hockenbroch · Jul 28, 2023 go to post

Phil, I'm not sure about VS Code, but you can do this in studio by creating a new CSP page with the following contents:

<csp:StudioSimpleTemplate name="CustomCommentHead" type="CLS" mode="new">
/// Organization:
/// Version 1.0
/// Author/Co-author:
/// Project: 
/// Date: 
/// Description: 
/// Change Log:
/// Notes:

Then save and compile that file. It doesn't matter where. Then when you click File, New, Custom, you'll see your CustomCommentHead template. If you choose it, you'll get a .cls file with those lines already inserted.

David Hockenbroch · Jul 25, 2023 go to post

Does the user you're using to access the API have proper permissions to use the API and the tables that it accesses?

David Hockenbroch · Jul 18, 2023 go to post

It looks to me like you might want to use %DynamicObject instead of %DynamicAbstractObject. %DynamicAbstractObject doesn't have a %Get method.

David Hockenbroch · Jun 29, 2023 go to post

I've used it with Cache 2018, but not as far back as 2016. You'll have to manually add the driver to DBeaver first to try it. To do that, first get a copy of the JDBC driver, which should be in the installation directory for your Cache instance. Look for a folder called dev, then java, then lib, then JDK17 or JDK18 depending on which version of Java is installed on your machine, then there should be a jar file with a name like cache-jdbc-x.y.z.jar. Copy that somewhere easy to get to.

In DBeaver, click on the Database menu, then Driver Manager. Click New. Give the driver a name like Cache 2016 or something you'll recognize. Under driver files, click Add File and choose that .jar file. The class name for the driver should be com.intersys.jdbc.CacheDriver. In the sample URL field put a URL that would connect to your Cache instance, which would look like jdbc:Cache//(server):(port)/(namespace). Click on Test Driver to verify. If it works, click OK.

Now when you go to Database, New Connection, you should see that driver listed as an option.

David Hockenbroch · Jun 29, 2023 go to post

If you're developing in Studio, open the file that contains that TestAccountSearchWithoutAccount method, then click the "View Other Code" button so you're looking at the INT code. If it says no other code to view, that's fine; you're already where you need to be. There should be a small text field near the top of the window with a drop down arrow on its left end. In that text field, type TestAccountSearchWithoutAccount+6 and press enter. That should take you directly to the line where the error is occurring.

Something on that line is trying to reference an object that doesn't exist. That's what "INVALID OREF" means. Whatever objects are on that line, check how they were created and/or opened and see if there's a chance that the object doesn't exist.

David Hockenbroch · Jun 29, 2023 go to post

What is the error message telling you? I'm not as familiar with working on a Mac as with Windows or Linux, but you need to make sure that the irisusr account has permission to create that folder at the operating system level.

David Hockenbroch · Jun 22, 2023 go to post

I believe that's an object handle. You could have a table with a column that contains ObjectScript objects, and in that case the query would return a reference to that object.

David Hockenbroch · Jun 22, 2023 go to post

@Luis Angel Pérez Ramos, you're looking at the deprecated %Library.ResultSet class. If this is using IRIS 2023.1, it's probably starting from a %SQL.Statement, and the ExecDirect method is returning a %SQL.StatementResult, which doesn't have that method.

David Hockenbroch · Jun 22, 2023 go to post

The columns have a clientType property. Is that what you're looking for? That would be:

set colType = cols.GetAt(x).clientType

That will get you an integer that corresponds to a data type, as documented here. So if that clientType is 1 it's Binary, 2 is a date, 3 is a double, and so on.

David Hockenbroch · Jun 21, 2023 go to post

After using your %ExecDirect() method, you should have a %SQL.StatementResult Object. Let's assume you called this object rs (for result set). So you did something like set rs = ##class(%SQL.Statement).%ExecDirect(blahblahblah). From there:

//Get the list of columns
set cols = rs.%GetMetaData().columns
//Loop through the result object
while rs.%Next(){
//Loop through the columns
     for x=1:1:rs.%ResultColumnCount{
     //Get the value of each column
         set colValue = rs.%GetData(x)
         //Get the name of each column
         set colName = cols.GetAt(x).colName
         //TODO: Add whatever you're doing with the name and value here
     }
}

David Hockenbroch · Jun 15, 2023 go to post

I don't believe you can do that without an ActiveX control for a Windows client. You might be better off figuring out how to present whatever it is you're trying to print for the user - either display it in the browser, or let them download the document - and letting them print it from there.

David Hockenbroch · Jun 7, 2023 go to post

Where you're using document.getElementById() in javascript, you're probably not getting the right element. If you right click on the element and inspect it in your web browser, you'll see that it has an id like zen13 or something similar.

Instead of document.getElementById('loading') try using just zen('loading'), for example:

zen("loading").style.display = "none"      

David Hockenbroch · May 25, 2023 go to post

Marc, I'm not asking about doing all of that from within the Intersystems report server. I'm asking about doing it from, say, an ObjectScript routine within IRIS.

David Hockenbroch · May 25, 2023 go to post

I don't see anything in that list about them.

I'm concerned that we're getting rid of something without really having a suitable replacement just yet.

David Hockenbroch · May 24, 2023 go to post

Is there much of an API for Intersystems Reports? We've used a lot of Zen reports as part of our ERP system where we're feeding parameters to a report and generating it to a stream, or emailing it as an attachment, or saving it to a file.

David Hockenbroch · Mar 21, 2023 go to post

Where I've used that second option to get an IP address, I've noticed that if the client has more than one IP address, it can return different ones different times, and I'm not sure how it determines which one.

David Hockenbroch · Mar 21, 2023 go to post

You can send texts through SMTP if you know the SMS gateway for the service provider. Several of these should be preconfigured on your instance of Cache or IRIS under System Administration, Security, Mobile Phone. You use the phone number @ that server as the email address to send to. For instance, if the phone number was 999-999-9999 and it was on AT&T, you'd send the email to 9999999999@txt.att.net.

So that's one way to do it, but I'm sure there are better ones.