#Caché

30 Followers · 4.5K Posts

  

InterSystems Caché is a multi-model DBMS and application server. See more details here.

Documentation.

Question Tamara Lebedeva · Aug 22, 2016

Hi, all. I have CSP application and it needs to get and process data from ajax request with json-content. JSON can be very big. In this case: TRY { Set RequestObj = ##class(%Object).$fromJSON(%request.Content.Read()) } CATCH(Exception) { Set Status=Exception.AsStatus() } I get just part of getting JSON and validate error in $fromJSON. If I try to read it all in cycle: TRY { While (%request.Content.AtEnd = 0) { Set Data=Data_%request.Content.Read() } Set RequestObj = ##class(%Object).$fromJSON(Data) } CATCH(Exception) { Set Status=Exception.AsStatus() } I get <MAXSTRING> error. Increasing of

6
0 1679
Question Sebastian Mueller · Aug 25, 2016

Let's imagine I have a global like this:

^Users(12, "SETTINGS", "IsAllowed") = 1

^Users(41, "SETTINGS", "IsAllowed") = 0

^Users(52, "SETTINGS", "IsAllowed") = 1

Now I would like to check for each user whether they are allowed, therefore I'd need to iterate through the Global. How to do that? It seems that I can't use $Order here like such:

S FF = ""
For {
 S FF=$O(^Users(FF,"SETTINGS","isAllowed"))
 Q:$L(FF)
 W "User ",FF," is allowed",!
}

Is there any other way of doing this? 

5
0 1279
Question Ponnumani Gurusamy · Aug 11, 2016

Dear Sir ,

               how to i run csp file . sometime csp file runs as at a time appear "Error  #670: could not attach to target".How to solve it.  Thank you

2
0 475
Question Nikita Savchenko · Aug 24, 2016

Hello community!

Is there any method/property/way in Caché to obtain something like unique identifier for installed Caché system? The idea is to get the identifier that will differ on any other installation/machine/etc, but will forever remain the same for the current installation, even if $zv changes (in case of update) or any data is removed from the database.

2
0 522
Question Chip Gore · Jun 28, 2016

Hi -

I have 3 classes: "Class A" has a property X, "Class B" has a property which is a Class A, and I have a "Class C" which has a property of a Class B.

Class A definition

Class USER.ClassA Extends %Persistent

{

Property Propx as %String;

}

Class B definition

Class USER.ClassB Extends %Persistent

{

Property Record as USER.ClassA;

}

Class C defintion (which is where I'm having my problem)

Class USER.ClassC Extends %Persistent

{

Property BRecord As USER.ClassB;

Property ARecord As USER.ClassA [ Calculated, SqlComputeCode = { ????? }, SqlComputed ];

Method ARecordGet() as USER.ClassA

{

 quit ..BRecord.ARecord

}

}

5
0 419
Question Derek Day · Aug 16, 2016

Has anyone configured Zen Reports/FOP to support png images? If you have, could you please share the library that you used, the configuration required, and whether it was worth it (vs converting images to one of the natively supported formats)?

3
0 738
Question Jose Antonio Cañizares · Aug 18, 2016

Hi,

We are trying to implement a client side data provider as a component (ZEN) that will use JQuery to do rest calls to a desired URL, in this case, a %CSP.Rest service implemented by ourselves.

This component will be used within our application that is authenticated with a correct user configured on Caché management portal and therefore using one license unit. As we are using a Ajax call from client side this connection creates a new session that will use a new license.

2
0 649
Question Jose Antonio Cañizares · Aug 1, 2016

Hi all,

For custormer support reasons we would like to know if its possible to activate some kind of flag or see/redirect wich is the code (lines) being executed when some misterious problems appear.

Is there any way to view the stack of execution code on a deployed code environment? Is there any other equivalent way to track the execution stack for a certain period of time?

Best regards

5
0 505
Article Mike Kadow · Aug 13, 2016 3m read

NewBie's Corner Session 17 New command

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

New command

The New command limits a variable's scope or range of use. In theory the New command is simple, in reality the New command is powerful and needs to be respected and understood.  In Caché ObjectScript and MUMPS an entire chapter is devoted to it.

There are three variations of the New command:

When used without variables

When used with variable(s)

When used with variables in parenthesis

New command used without variables

7
0 622
Article Eduard Lebedyuk · Aug 9, 2016 2m read

Process-private Globals  can be used as a data global in storage definition. That way, each process can have its own objects for the class with ppg storage. For example lets define a pool, which can:

  • add elements to a pool (ignoring duplicates)
  • check if an element exists in the pool

Here's the class:

2
0 1020
Question Laura Cavanaugh · Aug 11, 2016

I'm running into difficulty calling a javascript method from a Zenmethod.  I pass in a parameter, but in the javascript method the parameter is undefined.  Here is the code:

...

<button id="btnSave" caption="Save " onclick="zenPage.doSave();" controlClass="bButton"/>

...

Method doSave() [ ZenMethod ]
{

          If (..ID = "AddNew"){
                    //do save code here                   
                    &js<zenPage.doAddNew();>      //this works just fine, but there's no parameter
          }Else{
                    //do update code here

9
0 1748
Article Mike Kadow · Aug 12, 2016 2m read

NewBie's Corner Session 16 Introduction to New Concepts

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

A number of new concepts are introduced in this session that will be developed more fully in subsequent sessions. It is necessary to at least introduce these concepts here because they are all interrelated.

Older style of MUMPS Programming

0
0 319
Question Eduard Lebedyuk · May 23, 2016

Problem: I have a REST broker, and if I hit a code block, which does IO redirection, the REST reply becomes broken in one of the following ways:

  • Binary output
  • No output
  • First 4096 characters of the reply are missing

Consider the following REST broker:

3
1 1360
Question Ponnumani Gurusamy · Aug 12, 2016

How to get a user input in cache . Below this program run in browser but displayed the error of "

Caché Server Pages Version 2016.1.1.108.0

Error Condition      The processing of the request was interrupted

CSP application closed the connection before sending a complete response"

<html>
<head>
<title>User input </title>
</head>
<body>
<script language="Cache" runat="server">
"enter 1ST num",x
"Enter 2ND num",y
= x+y
z
</script>
</body>
</html>
 

1
0 695