Danny Wijnschenk · May 11, 2021 go to post

Do you use CSP pages or REST (through portal or other applications) ? It uses a grace period that can hold a license slot longer than the actual login time.

You can look at the license usage in the Management Portal :
- Click on View System Dashboard, in Licensing tab :

You can click on Current License Use, and click on the bottom of the page on 'Click here for more details' to go to the License Usage page (also accessible via System Operation -> License Usage)
You can view the same figures in terminal by using Do $system.License.ShowSummary()
(Look at Do $system.License.Help() for other methods to show license stats.

Danny Wijnschenk · May 20, 2021 go to post

This has probably to do with underscores ( _ ) in variable/method names. (not allowed in object script, but used with callbacks in the (deprecated) product VISM (or also called Cache Direct, hence the CD and CalBk in the error)
I get a similar error when doing :

%SYS>set _abc=1
 
<FUNCTION>SetProp+2^%CDCalBk
%SYS 3d1>

From the documentation :

Invalid Names

A local variable name that does not follow the above naming conventions generates a error. There is one exception: if an invalid variable name begins with an underscore character followed by a letter, the system generates a <_CALLBACK SYNTAX> error. (Note the underscore character within the error name.) For example, SET _abc = 123 or SET x = _abc. This is because Caché identifies these names as VISM control names, rather than local variable names.

Danny Wijnschenk · Jun 18, 2021 go to post

In terminal : 

USER>d ^%RCOMPIL
 
Routine(s): *
Routine(s):
Display syntax errors? Yes => Yes
Display on
Device:
Right margin: 80 =>
 
Compiling in namespace USER at 11:26:55
xxx.MAC    xxx3.MAC    ...
nn routines compiled with 0 errors at 11:26:55 in 00:00:00.029

In portal : System Explorer -> Routines 

Danny Wijnschenk · Jun 18, 2021 go to post

Hi Joan,

Are there many routines in the namespace ? Is the studio faster on other namespaces ?

Any special mapping in the namespace ?

Have you tried creating a new namespace and exporting/importing some routines to that namespace ? (or map routines to the new namespace)

Danny Wijnschenk · Jun 18, 2021 go to post

If your partners work in the same namespace without any problems, you might want to reset the Studio settings to default, or use their settings:

Studio menu Tools -> Import and Export Settings
First export your settings as a backup, and than reset All settings (or import a setting from a partner)
 

Danny Wijnschenk · Jun 21, 2021 go to post

Hi Joan,

hmm, running out of ideas,

can you create a new namespace (or use e.g. USER if not used), and map some routines from your database to that namespace. Is Studio also slow in that namespace ?

Danny Wijnschenk · Aug 12, 2021 go to post

You have to include a slash before EmergencyId :

iris start iris /EmergencyId=userA,pwB

Also, make sure that 'iris' is indeed your instance name (use 'iris all' to show all instances)

Danny Wijnschenk · Aug 12, 2021 go to post

Can you try again with the slash (since it is windows, you have to use the slash) :
iris start irishealth /EmergencyId=user,password

Danny Wijnschenk · Sep 5, 2021 go to post

Hi Lutz,

You have to assign your new %DB_Database1 & 2 resources to database1 & 2  (via System Admin -> Configuration->local databases->  click on database1 & 2  and change Resource Name to %DB_Database1 & 2

Danny Wijnschenk · Sep 13, 2021 go to post

Can you show the class definition ? Maybe it is better to try to find out why your iFilter is not taken as the best option for this query.

Danny Wijnschenk · Sep 24, 2021 go to post

Hi Kevin,

the variable statStr should be known inside your loop, e.g. following routine works fine in SAMPLES :

test    ;
         set statStr = "aa|bb|.."         set sqlStatement = "Select * From Cinema.Film"         set tState  = ##class(%SQL.Statement).%New()         set qStat   = tState.%Prepare(sqlStatement)         set rset    = tState.%Execute()         WHILE rset.%Next() {              Write rset.%GetData(1), " ",$Piece(statStr,"|",1),!         }         Quit
Danny Wijnschenk · Sep 24, 2021 go to post

Hi Muhammad,

Create following class :

Class Test.Json{

ClassMethod Get(date = "24-09-2021", debug = 0) As %String{  #Dim status as %Status  #Dim response as %Stream  #Dim jsonResponse as %DynamicObjectSet objHttp = ##class(%Net.HttpRequest).%New()  Set objHttp.Server="api.aladhan.com"  Set objHttp.Https=0  Do objHttp.SetParam("date",date)  Set status = objHttp.Send("GET","v1/gToH")  If status'=1 Do $SYSTEM.OBJ.DisplayError(status) Quit ""  If objHttp.HttpResponse'="" Do  Set response = objHttp.HttpResponse.Data  Set jsonResponse = ..GetResponse(response)  If debug Write jsonResponse.data.hijri.%ToJSON(),!  Return jsonResponse.data.hijri.date}

ClassMethod GetResponse(response As %Stream, del As %String = "") As %DynamicObject{  #Dim jsonStr as %String = ""  If response'="" {    Do response.Rewind()    While 'response.AtEnd {      Set jsonStr = jsonStr _ response.ReadLine() _ del    }  }  Quit {}.%FromJSON(jsonStr)}

}

and call it like :

USER>set hijri=##class(Test.Json).Get()
 
USER>write hijri
16-02-1443
USER>set hijri=##class(Test.Json).Get(,1)
{"date":"16-02-1443","format":"DD-MM-YYYY","day":"16","weekday":{"en":"Al Juma'a","ar":"الجمعة"},"month":{"number":2,"en":"Ṣafar","ar":"صَفَر"},"year":"1443","designation":{"abbreviated":"AH","expanded":"Anno Hegirae"},"holidays":[]}
 
USER>Write ##class(Test.Json).Get("01-08-2021")
22-12-1442
USER>
Danny Wijnschenk · Sep 24, 2021 go to post

And if you just want a function to return hijri dates, you van try following build-in  $zdate function :

Write $zdate($zdateh("2021-09-24",3),19),!
16 2 1443

You can also try ,18 which gives 16 Safar 1443

Danny Wijnschenk · Sep 25, 2021 go to post

Hi Muhammad,

Remove the 'Extends %Net.HttpRequest'  : it is not needed to inherit from this class.

Since the method Get is already defined in that class, it gives a compiler error when you overwrite a class with a different signature (classmethod).

Danny Wijnschenk · Dec 23, 2021 go to post

If property altura would be of type %Integer, you could use parameter d :
d - output Caché numeric properties that have value "" as null

SET tSC  = ##Class(%ZEN.Auxiliary.jsonProvider).%WriteJSONStreamFromObject(.tSteamJson,pObj,,,,"de")

As string, i don't see any parameters in %WriteJSONStreamFromObject that would return null in stead of "".
 

Personally, I am setting the json myself to have total control of JSON output like


set obj = ##class(...).%OpenId(...)
Set json = {"property1" : (obj.Property1), ... }
If obj.Altura="" Do json.%Set("Altura","","null")
;;%Set allows to set the correct datatype like numeric, boolean,string or force null
Write json.%ToJSON()
Danny Wijnschenk · Jan 6, 2022 go to post

Hi Matthew,
Can you enable auditing, enable the system event 'login failure' and check for login failures in the audit database ?
Do you have enough license available?

Danny Wijnschenk · Jan 7, 2022 go to post

Since the server version is Iris, it is better to use the latest ODBC driver from Iris ...

Danny Wijnschenk · Jan 7, 2022 go to post

Hi Matthew,
This should not add a lot of extra trafic - especially if you only enable the events you need to monitor (e.g. only enable login failure).

Danny Wijnschenk · Jan 18, 2022 go to post

I wrote a class to extend %Studio.Extension.Base, i don't see any other way to add items in Studio.
If you want, i can post a skeleton class where you can start with.

Danny Wijnschenk · Jan 18, 2022 go to post

Ok, this is a test i wrote to add some basic source control (auto save of class and manually exporting the current project). It shows how you can add 2 menu items.
Don't  forget to activate the source control class for a namespace in the portal (admin-config-additional settings-source control)
 

Class Studio.Extension Extends %Studio.Extension.Base
{XData Menu
{
<MenuBase>
<Menu Name="GIT" Type="0">
<MenuItem Name="Directory Setting"/>
<MenuItem Name="Export Current Project"/>
</Menu>
</MenuBase>
}/// Perform any login step here.
Method Login(Name As %String, Password As %String) As %Status
{
Write "==============================================================================================",!
Write "= Welcome ",$Get(Name),", this namespace is under source control by class Studio.Extension",!
Write "= Source files are saved in ",$Get(^SourceControl(0,$UserName,"GIT_Dir")),!
Write "==============================================================================================",!
Set ^SourceControl($J,"currentProject")=""
Quit $$$OK
}Method UserAction(Type As %Integer, Name As %String, InternalName As %String, SelectedText As %String, ByRef Action As %String, ByRef Target As %String, ByRef Msg As %String, ByRef Reload As %Boolean) As %Status
{
If $Piece($Get(InternalName),".",*)="PRJ" {
Set ^SourceControl($J,"currentProject")=$Piece(InternalName,".",1,*-1)
}
;Write "StudioExtension: Loading ",$Get(InternalName)," (",$Get(Type),"-",$Get(Name),"), current project is ",$Get(^sourcecontrol($J,"currentProject")),!
If Type=0 Do ..ExecuteMenu(Name, .Action, .Target, .Msg)
Quit $$$OK
}Method ExecuteMenu(Name As %String, ByRef Action As %String, ByRef Target As %String, ByRef Msg As %String)
{
If Name="GIT,Directory Setting" {
Set Target="Directory for GIT source control"
Set Msg=$Get(^SourceControl(0,$UserName,"GIT_Dir"))
Set Action=7
ElseIf Name="GIT,Export Current Project" {
Set Target="Export Current Project"
Set Msg=$Get(^SourceControl($J,"currentProject"))
Set Action=7
}
}Method AfterUserAction(Type As %Integer, Name As %String, InternalName As %String, Answer As %Integer, Msg As %String = "", ByRef Reload As %Boolean) As %Status
{
#Dim project, dir as %String;Write Type,Name,InternalName," : "
;Write "You answered ",$Get(Answer) ;1=yes, 0=no, 2=cancel
;Write "with message ",$Get(Msg),!
If Answer=1,Type=0 {
If Name="GIT,Export Current Project" {
Set project = Msg
Set objProject = ##class(%Studio.Project).%OpenId(project)
If objProject'="" {
Set dir = $Get(^SourceControl(0,$UserName,"GIT_Dir"))
If dir="" {
Write !,"StudioExtension: Please set GIT directory first"
else {
If $E(dir,*)'="\" Set dir=dir_"\"
Do objProject.Export(dir_project_$ZDate($H,8)_".xml")
}
else {
Write !,"StudioExtension: Project does not exist !"
}
Set objProject = ""
ElseIf Name="GIT,Directory Setting" {
Set ^SourceControl(0,$UserName,"GIT_Dir") = Msg
Write !,"StudioExtension: GIT Directory Saved"
}
}Quit $$$OK
}/// Called after the compile of the item is done.
Method OnAfterCompile(InternalName As %String) As %Status
{
#Dim dir, separator, items, extension, fullFileName as %StringSet dir = $Get(^SourceControl(0,$UserName,"GIT_Dir"))
If dir="" {
Write !,"StudioExtension: ","No directory setup to save source code"
else {
Set separator = $Select($ZV["Windows":"\",1:"/")
If dir'="", $E(dir,*)'=separator Set dir=dir_separator
Set extension=$Piece(InternalName,".",*)
Set dir=dir_extension_separator
Set fullFileName=dir_$Replace($Piece(InternalName,".",1,*-1),".",separator)_".xml"
Do ##class(%File).CreateDirectoryChain($Piece(fullFileName,separator,1,*-1))If 0 {  ;do not export as .xml file for Git :
Set items(InternalName)=""
Do $system.OBJ.Export(.items,fullFileName)
Write !,"StudioExtension: ",InternalName_" saved as "_fullFileName
}If $Piece(InternalName,".",*)="CLS" {
Set $Piece(fullFileName,".",*) = "cls"
If $system.OBJ.ExportUDL(InternalName,$Replace(fullFileName,".xml",".cls")) {
Write !,"StudioExtension: ",$Piece(InternalName,".",1,*-1)," saved as ",fullFileName
else {
Write !,"StudioExtension: ","Error while saving "_$Piece(InternalName,".",1,*-1)," as ",fullFileName
}
}
}
Quit $$$OK
}}
 
Danny Wijnschenk · Feb 3, 2022 go to post

There are also other ways code can use globals :
- routines that are stored in other namespaces
- code in globals (yes, i admit very unlikely but possible) 
- indirection (also unlikely but possible)
If journaling is enabled, you could also look in the journal file via management portal, and search for the global to see when it is used.

Danny Wijnschenk · Feb 7, 2022 go to post

Marco, you can enable Audit, enable LoginFailure warning, and look in the Audit messages for more info on the LoginFailures.

Danny Wijnschenk · Feb 9, 2022 go to post

Can you show the class definition ? 
If you use standard string properties, it could be longer than the default maximum length (50).