go to post Matjaz Murko · Jul 19, 2022 Are you testing from same machine? Maybe the firewall is causing the problem?
go to post Matjaz Murko · May 30, 2022 Hi. s Line=""While ('File.AtEnd) { s Line=Line_File.Read(1000)_$char(10) } You need to declare variable Line before you concatenate it (or use $Get(Line,"")). Regards,Matjaž P.S.It is better way to use stream as Crisitano suggested...
go to post Matjaz Murko · May 28, 2022 I was just trying to point out the cause of the problem. There are many ways to do the same job :)...
go to post Matjaz Murko · May 28, 2022 Hi. In this part of the code: Set Line = File.Read(1000)While (File.Read(1000)'="") { S mystring=mystring_File.Read(1000) you are reading first 1000 chars which are not included in mystring and again in each loop checking the while condition you are reading 1000 chars and this chars are not included in mystring. It should be: //Set Line = File.Read(1000)Set mystring = ""While ('File.AtEnd) { S mystring=mystring_File.Read(1000) } Regards,Matjaž
go to post Matjaz Murko · May 17, 2022 Hi.You are getting pure html, not a JSON serialized string. You need the correct URL/port where the REST server is listening. Regards,Matjaž
go to post Matjaz Murko · May 16, 2022 Hi. Set request=##class(%Net.HttpRequest).%New()Set request.Server="something.com"Set request.Port="some_port"Set request.Username="some_username"Set request.Password="some_password" Set status=request.Get("some_url") Do request.HttpResponse.Data.Rewind()Set jsonString=request.HttpResponse.Data.Read(request.HttpResponse.Data.Size,.sc) Set jsonObject={}.%FromJSON(jsonString)Write jsonObject."some_property" ... Something like that... Regards,Matjaž
go to post Matjaz Murko · May 16, 2022 Hi. There is a COS function $ISVALIDNUM where you can check if the variable is valid number. Regards,Matjaž
go to post Matjaz Murko · May 6, 2022 Hi. It works with the parameter JSONLISTPARAMETER set to "DISPLAYLIST". But is it possible to set that parameter in XData mappings, so it can be use either way (DISPLAYLIST or VALUELIST)? Regards,Matjaž
go to post Matjaz Murko · May 4, 2022 Hi. Class code: Class MasterData.Product Extends (%Persistent, %JSON.Adaptor){Property Department As %String;Property Ident As %String;Index ProductId On (Department, Ident) [ IdKey, Unique ];Property Name As %String;Index Name On Name;Property Type As %String(DISPLAYLIST = ",Sveže,Zmrznjeno,Dodelava", VALUELIST = ",FRE,FRO,FIN");Property CUsInTU As %Integer;Property NominalWeightCU As %Numeric;Property WeightClassCU As %String;Storage Default{<Data name="ProductDefaultData"><Value name="1"><Value>%%CLASSNAME</Value></Value><Value name="2"><Value>Name</Value></Value><Value name="3"><Value>Type</Value></Value><Value name="4"><Value>CUsInTU</Value></Value><Value name="5"><Value>NominalWeightCU</Value></Value><Value name="6"><Value>WeightClassCU</Value></Value></Data><DataLocation>^MasterData.ProductD</DataLocation><DefaultData>ProductDefaultData</DefaultData><IdLocation>^MasterData.ProductD</IdLocation><IndexLocation>^MasterData.ProductI</IndexLocation><StreamLocation>^MasterData.ProductS</StreamLocation><Type>%Storage.Persistent</Type>}XData RotorDataMapping{<Mapping xmlns="http://www.intersystems.com/jsonmapping"><Property Name="Ident"/><Property Name="Name"/><Property Name="Type"/></Mapping>} I would like the property Type to be exported (%JSON.Export("RotorDataMapping") method) with display member rather than value member. Regards,Matjaž
go to post Matjaz Murko · May 3, 2022 Sorry, my mistake. JSON_OBJECT should parse %TimeStamp value to ISO 8601 format, but it doesn't. So my question is how to do it... Regards,Matjaž
go to post Matjaz Murko · May 3, 2022 Hi. I've already tried it, but with no success. But I recently upgraded IRIS to the newest version and it works. Tnx. Regards,Matjaž
go to post Matjaz Murko · Apr 12, 2022 Hi. Try this: select convert(varchar,dateadd(ss,avg(datepart(hour,timeSpent)*3600+datepart(minute,timeSpent)*60+datepart(second,timeSpent)),0),108) from myclass Regards,Matjaž
go to post Matjaz Murko · Feb 24, 2022 Hi.You should use function $QUERY ($QUERY | ObjectScript Reference | InterSystems IRIS Data Platform 2020.1). Regards,Matjaž
go to post Matjaz Murko · Jan 9, 2022 Hi.I've used Cache/IRIS Native Provider, but recently I'm moving all my apps to REST. It is OS/IDE independent and commonly used. Cache/IRIS REST API services are very efficient and very easy to use. Recommended. Regards, Matjaž.
go to post Matjaz Murko · Jan 4, 2022 Hi. Have you tried: Property radiusmean As %Numeric(SCALE = 5); Regards, Matjaž