Question Vivian Lee · Sep 13, 2024

How do you iterate over the array of namespaces returned in the result byref from the call below?

DO ##class(%SYS.Namespace).ListAll(.result)

Running "zw result" displays the namespaces (as individual subscripts in result) in the Terminal but I want to be able to programmatically iterate through each namespace name. 

The documentation for ListAll() mentions here that result will be a local array name passed by reference. Is there a way to turn it into a dynamic array?

0
0 0
Announcement Vivian Lee · Mar 11, 2024

Now users can filter the CCR table by multiple conditions for the CCR tables displayed on the home page and the CCR tab of the System Details page.

Previously users were only able to filter the rows by one condition at a time. This made it cumbersome for users to quickly find CCRs that they knew met multiple conditions, as they would have to choose the condition that would produce the least number of results for them to then manually filter through. 

0
0 186
Question Vivian Lee · Jul 7, 2023

Is "time" a reserved word in the %CONTAINS function?

When I run the following SQL query, I get 0 matching results

SELECT ID, text
FROM Test.Sentence
WHERE text %CONTAINS('time') OR text %CONTAINS('time ') OR text %CONTAINS(' time')

However, when I run a query where the search string contains words other than "time" alone, it returns the expected matching results

SELECT ID, text
FROM Test.Sentence
WHERE text %CONTAINS('providers time money') OR text %CONTAINS('providers time') OR text %CONTAINS('time money')

It also works if I try to search for "tim" or "ime"

7
1 394
Question Vivian Lee · Dec 20, 2021

I'm trying to send an HTTP POST request with form-data from an Angular app to a Cache backend, but my request fails with a 406 Not Acceptable error.

httpRequestHeaders = new HttpHeaders({
  Authorization: 'Bearer ' + sessionStorage.getItem('access_token'),
  Accept: ''
}); 

uploadFile(file: File) {
  const formData: FormData = new FormData();
  formData.append("file", file);
  const req = new HttpRequest("POST", this.postURL, formData, {
    reportProgress: true,
    responseType: "json",
    headers: this.httpRequestHeaders,
  });
  return this.http.request(req);
}
2
0 15963
Article Vivian Lee · Dec 15, 2021 3m read

Setting the Scene

I was editing the properties of a persistent ObjectScript class the other day and noticed that the storage definition wasn't updating to reflect my latest changes.

In this case, I deleted a property that was no longer needed from the class definition, saved, recompiled, and still saw it in the storage definition.

No problem, I thought. If the storage definition gets autogenerated on compile, I can just delete it and recompile the class. Sure enough, after doing this, I no longer saw the deleted property in the storage definition.

There, problem solved... right?

7
3 820
Question Vivian Lee · Nov 18, 2021

Hi Dev Community,

I have a persistent Document class that has a FileName string property and another Question class that has an optional one-to-many relationship with Document.

I'm trying to add a SqlComputed property to the Question class (docFileName) where docFileName = Document.FileName if there is a related Document or an empty string if there isn't one. 

I'd prefer the property to be SqlComputed so that if Question.Document changes, Question.docFileName will automatically update.

Does anyone know the syntax for accessing the properties of a related object in the SqlComputeCode?

Thanks!

12
0 587