go to post Danny Wijnschenk · Jul 5, 2020 Hi Anthony, Look at the doc for the property EntityBody, you can do something like : Set body = { "MyKey":"MyValue" } Do httpRequest.EntityBody.Write( body.%ToJSON() ) property EntityBody as %GlobalBinaryStream; When an Entity-Body is included with a message, the data type of that body is determined via the header fields Content-Type and Content- Encoding. These define a two-layer, ordered encoding model. This is a stream so to insert into this stream use: Do oref.EntityBody.Write("Data into stream")
go to post Danny Wijnschenk · May 20, 2020 Use %SQL.Statement for dynamic sql, do not use %ResultSet anymore (it is slower).
go to post Danny Wijnschenk · Feb 18, 2020 Can you include the class definition so we can take a look ?
go to post Danny Wijnschenk · Feb 7, 2020 Hi Yone, Following link explains how to do the same in 2016.1 : https://cedocs.intersystems.com/ens20161/csp/docbook/DocBook.UI.Page.cls?KEY=GJSON_tojson But you risk writing code which will be incompatible with later versions as much of the json syntax of pre 2016.2 is not valid anymore.
go to post Danny Wijnschenk · Feb 7, 2020 Hi Yone, what version are you using ? From Caché/Ensemble 2016.2 you could create your json directly like : Set body = { "app_id": "e47322de-64c8-43c5-a1b7-42aa6409eb48", "headings": {"en":"Cita Atencion Primaria","es":"Cita Atencion Primaria"}, "subtitle": {"en":"C.P. ISORA","es":"C.P. ISORA"}, "contents": {"en": "Next appointment", "es": "Siguiente cita"}, "data":{ "centro": "C.P. ISORA", "fecha": "yyyy/mm/dd", "hora": "hh:mm", "profesional": "nombre del profesional", "nomUsuario": "nombre del usuario", "codcita": "idCita", "sepuedeborrar": 1 }, "include_player_ids": ["2b3a6be7-5475-4871-b3be-a50eb2ec6034"]} Do httpRequest.EntityBody.Write(body.%ToJSON())
go to post Danny Wijnschenk · Jan 7, 2020 Hi Raj, I use different IDE's and combinations : - Caché Studio without any extensions for development where i am self-employed and no other developers are involved - Caché Studio with Serenji source control from Gerorge James for a particular customer where i am one of the developers - Visual Studio Code with the vscode-objectscript extention from Dmitry Maslennikov for another customer where i am one of the developers. I like Caché Studio since I use it from day 1, because it is build-in so no need to configure anything. I use the 'projects' feature a lot, and export my projects regularly as a sort of 'light' source control. (I even edit my html and js files in Studio, even when they contain no COS code at all.) But when developing in teams a good build-in source control is essential, so that's why i also use the other options. I am still learning Visual Studio Code but it seems the way for the future.
go to post Danny Wijnschenk · Jan 6, 2020 Hi Youness, There is no direct way from within Caché to modify excel sheets. I use .csv files, or generate a .txt file, and call an excel file that runs a macro to read the data, and set all the stuff using VB code in the macro. You can look at this article that talks about different options : https://community.intersystems.com/post/use-cache-write-excel-files
go to post Danny Wijnschenk · Jan 6, 2020 Hi Youness, how are you exporting the data to excel : as a .csv file ? I am not sure if this is your problem, but when exporting data (numbers) to excel, you need to be careful on the decimal character you are using : if i export numbers with a decimal point, and my locale is set on comma as a decimal , the numbers are treated as strings, and no validation works.
go to post Danny Wijnschenk · Jan 6, 2020 Hi Evgeny, the info is at least unreliable, so i vote to ask the author to delete this information from the article. There is already too much fake news on the internet, lets make this little part of the internet as reliable and accurate as possible !
go to post Danny Wijnschenk · Nov 27, 2019 set myVar="",$piece(myVar,"=",31)="" ;repeat = 30 times works also with multiple characters : USER>set myVar="",$piece(myVar,"=?",31)="" USER>write myVar=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?
go to post Danny Wijnschenk · Nov 14, 2019 It all depends from which backup and journal files you start the recovery. You need to start from a backup & all journal files from before your event that killed the data (and stop the restore just before that event, which i assume is 11/14/2019 15:18:56). What happened on this time : did you kill some data or remove the class ? It seems that the restore did not fully restored the class definition : can you go into studio and recompile the class ? In the class definition, you will find the actual global names where the data is stored (by default it will be ^User.MemberD and ^User.MemberI (and possibly ^User.MemberS). Do you have these globals after the restore ?
go to post Danny Wijnschenk · Oct 19, 2019 There is no general answer if it is possible : it depends on the application : I have done conversions in a few hours, but had also conversions that took a lot longer or were impossible without heavy rewrite of code. Depends on : - use of OS-dependencies (VMS/VAX) like working with files/devices or print operations - use of 'non-standard' Mumps syntax, or relying on specific formats of special variables - use of DSM-11 tools (like DASL) or OS tools - available source code - ...
go to post Danny Wijnschenk · Sep 26, 2019 Hi Everardo, I have seen the error, but not in testing ensemble messages : USER>Write _test1 <FUNCTION>GetProp+2^%CDCalBkUSER 3e1> variables preceded by _ (underscore) are only to be used in Caché Direct (VISM) programs. Are you running any code that uses too much underscores ? For example : USER>set var1=1 USER>set var2="a"_var1 USER>set var2="a"__var1 ;two underscores <FUNCTION>GetProp+2^%CDCalBk USER 3e1>
go to post Danny Wijnschenk · Sep 24, 2019 Any special mappings in that namespace? Size ? Try to export classes and routines from that namespace and import them in a new namespace, is it still slow in the new namespace?
go to post Danny Wijnschenk · Sep 22, 2019 Hi Gunwant, can you show us the postman screenshot, and your resthandler class. It will be much easier for the community to solve your problem with this info, than having to guess, Friendly Regards
go to post Danny Wijnschenk · Sep 12, 2019 Caché IS a virus : once you get it, you can never get rid of it
go to post Danny Wijnschenk · Aug 18, 2019 I prefer option 3 as the other options only makes your code more unreadable.We could use <GLOBAL>^MyGlobal</GLOBAL> in the documentation, and write some script to generate a summary page of all classes that point to this global...
go to post Danny Wijnschenk · Aug 14, 2019 Are you pointing the filestream to the correct file : is there any data in the filestream (you are using \Temp\GaganTest : it will use the same drive as the one where your database is located, also no extension is mentioned)You can set a timeout (Set ftp.Timeout = 100) if the ftp server times out when uploading big files.The file size will not effect your cache.dat size.
go to post Danny Wijnschenk · Aug 9, 2019 Hi Bava,Try giving the user the Role %EnsRole_MonitorMore info on all the Ensemble Roles you could give the user are found here : https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=EGMG_security_roles
go to post Danny Wijnschenk · Aug 8, 2019 Hi Robert,take a look at the %SYS.Journal.File , %SYS.Journal.Record and %SYS.Journal.SetKillRecord classes.It contains methods & properties to loop through the journalfiles, and get the information of all changes. You could then write this info in a (summarized) file and email it. ClassMethod ShowJrn(file = "C:\InterSystems\Cache\mgr\journal\20190804.001"){ Set jrnforef = ##class(%SYS.Journal.File).%OpenId(file) set record = jrnforef.FirstRecordGet() While record'="" { If record.%ClassName()="SetKillRecord" { Write record.Type,! ;6 = SET, 7 = KILL Write record.GlobalReference,! Write record.OldValue,! Write record.NewValue,! } Set record = jrnforef.GetRecordAt(record.NextAddress) }}