go to post Matthew Giesmann · Sep 13 w ##class(%SYS.Namespace).ListAll(.out) is what I would use and just $order over ithttps://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic....
go to post Matthew Giesmann · Jul 3 GenerateAfter can help here. ///do ##class(Test.GenerateHelper).Generated() ///Hi there! Class Test.GenerateHelper { ClassMethod Generated() [ CodeMode = objectgenerator, GenerateAfter = Helper ] { set text = ..Helper() do %code.WriteLine(" write """ _ text _ """") } ClassMethod Helper() As %String { return "Hi there!" } }
go to post Matthew Giesmann · Jun 5 Is it a ZEN Select component rather than just an html select? If so, maybe set the displaylist and value via the ZEN helpers? From memory (and it has been a long time), something like:var select = zen(zenIdOfSelect)select.diplayList='one,two,three'select.setValue(3)select.refreshContents()
go to post Matthew Giesmann · Mar 28 Quick note on one thing has come up a few times - the new view page does have a link to the home page. From any page, clicking the "I" icon in the top bar goes to the CCR home page, and the top option in the hamburger menu is "Home".
go to post Matthew Giesmann · Apr 12, 2023 Wouldn't the quickest way just be something like $System.OBJ.Export(.items, exportfn) and $System.OBJ.Load(exportfn, "c")?https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic....
go to post Matthew Giesmann · Aug 1, 2022 Hi Michael, This isn't a straight answer to the problem of extracting business logic from CSP pages - but if you haven't already, check out the isc.rest project. Its an open source release of the framework we've been using to migrate our CSP and Zen apps to REST (Angular front end). If nothing else, it provides a uniform, safe and easy to maintain way of creating a REST API from an existing application. My process has generally been to copy CSP business logic to a class method in the relevant persistent class and expose it as a REST Action there (see Defining Actions in isc-rest user guide). Its possible to expose any method in this way, so depending on your situation, it could make sense to point an action endpoint to the class methods in CSP directly, or use a wrapper method.This recent presentation is a great place to start: https://learning.intersystems.com/course/view.php?id=2102 git hub: https://github.com/intersystems/isc-rest
go to post Matthew Giesmann · Dec 17, 2021 Thank you, @Robert Cemper and @Eduard Lebedyuk!I did not know about MANAGEDEXTENT, assuming there was no way to use the same storage in another class. Ed's warning is relevant though, I can't ensure that there wouldn't be other concurrent writes. Here is my working solution.... Subclassing of the record class with Setters for the 2 properties seems to work. Simply overriding the 2 properties without [ SqlComputed ] did not change the computed behavior. Class Audit.HistoricalRecord Extends Audit.Record { Method LastModifiedTimeSet(value As %String) As %Status { Set i%LastModifiedTime = value quit $$$OK } Method LastModifiedUserSet(value As %String) As %Status { Set i%LastModifiedUser = value quit $$$OK } } My migration routine can now create and save objects of the HistoricalRecord class
go to post Matthew Giesmann · Oct 22, 2019 Hi David, thanks for this suggestion. File names that include full version strings are now visible prior to download.
go to post Matthew Giesmann · Oct 7, 2019 While using &SQL without a CURSOR will always only execute once and return one row, the SQL optimization is still dependent on the specific query - so while the cost of the non-top query is much higher, what really matters here is cost to first row. For the example query, that will be minimal, but could be much higher in a more complicated case.
go to post Matthew Giesmann · Aug 15, 2019 I haven't tested to see if it matters, but I see that CreateCoffee() isn't returning a %Status.
go to post Matthew Giesmann · Aug 14, 2019 From the docs on the SQL Gateway"All the tables listed in the FROM clause of an SQL query must come from the same data source. Queries that join data from heterogeneous data sources are not allowed."https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?K...You might be able to use a sub query to work around this:select * from tableusers u JOIN (SELECT * FROM tablelogentries) e ON e.userid = u.useridI would contact the WRC if the above workaround doesn't cover all of your use cases.
go to post Matthew Giesmann · May 8, 2019 Hello Luk,I have seen "Error Condition: Failed to read posted content from the client" due to a quirk in how IE resends some requests after a network timeout. This discussion on stackoverflow describes the IE behavior I saw that resulted in these messages:https://stackoverflow.com/questions/4796305/why-does-internet-explorer-not-send-http-post-body-on-ajax-call-after-failureI would try to isolate what CSP requests are causing the messages.
go to post Matthew Giesmann · Jan 18, 2019 Hello Dhaval,I don't believe that there is a clean way to access the property you are looking for, though you may be able to finagle the data you need in SQL with the $list function.On the first array level (Employee), Cache projects the property as a table, allowing for easy SQL access. However, because Employee is not Persistent, it cannot project its address array property as a table. Any SQL access will have to deal with the $listbuild that the second level array is stored as.If possible, I would make Employee a stand alone table, maybe as a Relationship rather than an array.
go to post Matthew Giesmann · Jan 3, 2019 I recall seeing this work before, but I believe it took a good amount of extra javascript work to get the ZEN drag and drop mechanisms (see doc) working nicely with the cells of tablePane.
go to post Matthew Giesmann · May 24, 2017 In general, "list of ___" properties don't play well with SQL. Looks like we just present the list as a string.Using the Generate CREATE TABLE statement feature of WinSQL for Sample.Person gives: FavoriteColors VARCHAR(4096)
go to post Matthew Giesmann · Nov 10, 2016 Hello Mikhail, Good question!I think of block count as a rough estimate of the disk size of a table or index (an "SQLmap"). The SQL optimizer uses this to get an estimate of how much disk I/O could be involved in scanning that map. Block count mostly matters in proportion to other block counts (similar to ExtentSize). I am not certain how to interpret 2K reference in the documentation, perhaps someone else will chime in - my guess is that the "units" don't matter, so the original 2K block size is still used as a base unit for measuring the disk size of a storage map.Block Count can be extremely important for tables that have child tables, or that otherwise share a storage global with other classes. The row count might be relatively small, but because the global nodes are spaced out, more disk I/O is required. With the block count taken into consideration, the SQL optimizer may be pushed toward an index or different starting table.
go to post Matthew Giesmann · Oct 31, 2016 It is possible that a query can skip the master map completely, but only if all fields being selected are in the index and in the same form as in the master map. Even if all fields are in an index, indexed fields are typically stored in SQLUPPER, required for SQL comparisons, but the query must get the fields in their original form for output. So for a SELECT *, the query will almost always need to go back to the mastermap.