ObjectScript

Syndicate content 34 

Good day,

We upload images into the database with this code :

<tr>
<td align="right">FileName</td>
<td><input type=file size=200 name=FileStream></td>
</tr>

s FullFilename = %request.Get("FileName")
s FileName = ##class(%File).GetFilename(FullFilename)
s ItemImage.FileName = FileName

+ 1   0 3
0

comments

63

views

+ 1

rating

When using $SYSTEM.Status.DecomposeStatus(tSC, .tErrorList) in ObjectScript to get the lsit of errors (I need to do this so that I can generate a custom JSON with the error messages) what is the type of tErrorList returned and how to intialize?

Last answer 7 days ago
0   0 3
0

comments

40

views

0

rating

I have SQLCompute with SQLComputeCode on a couple of Properties in my class.

These work fin when I insert/update via ObjectScript or SQL from the ManagementPortal.

However, if I insert (create new record) via my C# app using the Caché ODBC DLL the SQLCompute is ignored, it does not run.

Is this expected InterSystems Caché behaviour? We are on latest IRIS platform.

Last answer 13 November 2019 Last comment 13 days ago
0   0 2
89

views

0

rating

Hi everyone,

I've encountered this annoying issue so many times before, if any one also encounter this issue, please share here if you have any solution.

So, I've been working on a web service project using HealthShare 2015. Sometimes I have to set a debug target to a csp file to debug it. If I pause the debug process about 3 minutes above or so (to examine an object, variable, etc..) the studio will hang.

Last answer 15 November 2019
0   0 3
0

comments

52

views

0

rating

Hi Community!

Sometimes I meet a method which accepts 10+ parameters.

And often I need only the 8th parameter  to  pass. And I call the method something like:

do ##class(Some.Feature).Method(,,,,,,,"flag")

And I don't like this method when I call it like this cause, you know, often I just miss the number of commas and raise some other flag I wanted.

How do you avoid this situations? 

If you meet such a code, how do you call it and sure that you didn't miss the number of ","?

What is a good number of parameters in a method and f you need to pass more parameters in a method what do you do?

Last answer 5 May 2019 Last comment 27 August 2019
+ 3   1 12
545

views

+ 3

rating

Hello everyone!

Does anyone know of a library that can be used to create Mock objects for Objectscript classes?

Right now, my team has been building mock objects by hand to help circumvent dependencies when writing and executing unit tests, but I always wondered if someone had ever created a Mock library like Mockito to help quicken the process. 

Thanks!

Last answer 10 October 2017 Last comment 26 August 2019
+ 3   0 4
403

views

+ 3

rating

I have a list property that I query from the database to get the values contained in that list using $LISTFROMSTRING() when the list is returned the list values contain a rectangle like character similar to when you copy past something to the Terminal and it has a preceding space .The problem is I need to compare those values to other values and they do not match because of this value I have tried to use $EXTRACT(value,*W) and *P but this is not striping the preceding character how do I get rid of this character any ideas please. 

Last answer 15 August 2019 Last comment 15 August 2019
0   0 2
149

views

0

rating

Hello All,

I need some help:

 I would like to create Web Application using our ZEN with Cache DB so please guide me.

1.What is difference between zen page and zen application.

2.what is the difference between Client Method and server Method then where to use it.

Thanks.

Last answer 12 August 2019 Last comment 14 August 2019
0   0 3
142

views

0

rating

Hey Guys,

I got stuck with this for 2 days, please help me

Actually my logic is when I enter the input on the text field in browser, the entered input to be print on the next page but I am getting "Undefined". How to i do it.

Below is my code:

 

 

Last answer 10 August 2019 Last comment 10 August 2019
0   0 2
129

views

0

rating

Hi developers!

Just want to check with you on best practices for that.

You collaborate for InterSystems IRIS repository. You fork it, then make changes, commit, push, pull request, discuss(if any), your PR is accepted.

What's next? 

Do you delete the repository you forked in?

 

 

Last answer 8 August 2019 Last comment 23 July 2019
0   0 3
88

views

0

rating

Hi,

I have a method that has multiple parameters and is normally used from other classes in ObjectScript. Most of the parameters have default values. Withing the server code that's perfect. In some areas I can call myMethod(,,"sometext") or myMethod(tVariab) and thats fine... I use it as it's required in each place.

But now I want to expose it as a REST service so I need to buld a kind of wrapper., another method in a REST dispatcher class that will receive the parameters in a JSON object and will call the server method already implemented. Something like:

Last answer 7 August 2019 Last comment 7 August 2019
0   0 3
123

views

0

rating

Hello,

Is it possible to write global output values to STDOUT, in a similar way to how csession can take routine intput, like below:

 

(In Cache Terminal)

%SYS>d ##class(%SYSTEM.License).ShowSummary()

 

License Server summary view of active key.

 

     Distributed license use:

Current License Units Used =        1

Maximum License Units Used =        1

License Units   Authorized =      200

 

     Local license use:

Current Connections =      1  Maximum Connections =      1

Last answer 30 July 2019 Last comment 31 July 2019
0   0 2
147

views

0

rating

Hey Intersystems-Developer,

 

I have already used that and know its possible, but can't find it anymore :(

 

I need dynamic access on proxy objects. For example:

set key = "lastName"

set name = obj.name

set lastName = obj.key <- Not possible 

set lastName = obj.GetAt(key) <- Not possible

 

How can I get access to that object with my dynamic variable "key" ?

 

Best regards. 

Last answer 9 July 2019 Last comment 9 July 2019
0   0 1
125

views

0

rating

Hi guys!

As you know there are two (at least) ways to get the stored value of the property of InterSystems IRIS class if you know the ID of an instance (or a record).

1. Get it by as a property of an instance with "Object access":

ClassMethod GetPropertyForID(stId As %Integer) As %String

{

set obj=..%OpenId(stId)

return obj.StringData

}

2. Get it as a value of a column of the record with "SQL access":

Last answer 29 June 2019 Last comment 6 July 2019
0   0 4
158

views

0

rating

Hi Dev Community,

My team is currently working on a project where we need to post pdf documents to a 3rd party REST API.

The API specifies a field in the JSON request message to contain the 'physical content' of the file as an array of bytes, example of the JSON request as follows - data truncated for readability purposes:

Last answer 1 July 2019 Last comment 17 June 2019
0   1 4
316

views

0

rating

Hello,

Working on to learn very basic CUSTOM Business Service which sends to a EnsLib.File.PassthroughOperation.

But operation is not writing to File and erroring out (No Stream contained in StreamContainer Request")'.

How do convert the object to STREAM and wrap in the StreamContainer so the operation does not error and write to a file.

Thanks.

Persistent Class

Last answer 26 June 2019 Last comment 28 June 2019
0   0 3
181

views

0

rating

Hi,

We have a function that takes two parameters, the second one is for output value:

MyFunc(Param1,Param2)

 S Param2="it's all good"

Q 1

 

How can we detect if the caller called the function with one, or two arguments?

Meaning,  how to distinguish this call:

S Result=$$MyFunc(1)

from this call:

S Result=$$MyFunc(1,.OutVal)

 

Thanks!

Nael

Last answer 27 June 2019 Last comment 27 June 2019
0   0 1
175

views

0

rating

Forgive my lack of understanding, but I am working on a vendor created Cache database and the indexes specified in the classes for ODBC connections are not working. A few of them are created, but of the 50+ classes we have, only a handful of them are created when the class is compiled, yet no errors occur.

Example 1:

 

Example 2:

 

Last answer 31 May 2019 Last comment 18 June 2019
0   0 3
209

views

0

rating

Noticed some unexpected behavior when using $ZTH

Resultant values less than 1 are treated as strings and values >=1 are numbers.  Causing heartburn in $Query / $Next / $Order loops. Is there a setting somewhere that can change this?

Example:

// Parse the time out of a text string whose format is YYYYMMDDHHMMSSsssssssss   (lower case s = fractional parts)

Set MsgDT = "20180405000000001005933"
Set MsgDTH = $ZTH(($E(MsgDT,9,10)_":"_$E(MsgDT,11,12)_":"_$E(MsgDT,13,14)_"."_$E(MsgDT,15,23)),1)

//Do it again, but add a sec to the time string 

Last answer 15 June 2019 Last comment 17 June 2019
0   1 3
234

views

0

rating

I am trying to pull the word count from Microsoft Word document into Cache. Is there anyway to get the values of the extended file properties without opening the word document?  If I right click on a word document (Word does not need to be installed) I can see the additional properties that I want to reference however don't know how to access these without calling out to VBA or poweshell.

 

 

Last answer 14 June 2019 Last comment 17 June 2019
0   0 2
129

views

0

rating