Robert Cemper · Aug 26, 2023 go to post

Hi @Lorenzo Scalese 
I guess you are looking for class(%Utility).FormatString()

USER>set lb=$lb(1,"Lorenzo",2023,"RCC"_$c(13,10))
USER>write lb
      LorenzoçRCC
 
USER>zzdump lb
0000: 03 04 01 09 01 4C 6F 72 65 6E 7A 6F 04 04 E7 07         .....Lorenzo..ç.
0010: 07 01 52 43 43 0D 0A                                    ..RCC..
;;;;;  this is it
USER>set viewlb=##class(%Utility).FormatString(lb)
 
USER>write viewlb
$lb(1,"Lorenzo",2023,"RCC"_$c(13,10))
USER>zwrite viewlb
viewlb="$lb(1,""Lorenzo"",2023,""RCC""_$c(13,10))"
Robert Cemper · Aug 26, 2023 go to post

Objectscript uses double quotes for strings.
Single quote is Negation 
 'Sample Data  looks for variable  Sample >>> NOT Sample

Robert Cemper · Aug 25, 2023 go to post

Totally correct.
This is what the example describes:
and the consequence is that you have to spin through ALL GetOrgUpdatesResponse objects
A less impressive design.
So you need to add an index on the ELEMENTS of your  Property Organizations
to find all affected objects.
some example of how to

Robert Cemper · Aug 24, 2023 go to post

in this case store it in  +$HOROLOG format as explained
and leave the conversion to   YYYY-MM-DDT00:00:00Z  to output
using

  • $system.SQL.TOCHAR(+$h,"YYYY-MM-dd")_"T00:00:00Z" or
  • $zd(+$h,3)_"T00:00:00Z"

+$h stands for your property DOB as %Date

Robert Cemper · Aug 23, 2023 go to post

Your transformation produces  a YYYY-MM-DD HH:mm:SS string
in contradiction 
Property DOB As %Date;   expects an Integer similar to +$h 
The error is reported during Validation before %Save() of  your record

  • either you change  Property DOB As %String;
  • or use '$zdateh(source.DOB,7,,,,,,,,"")'   then ##class(%Date).IsValid(...)  is happy
Robert Cemper · Aug 18, 2023 go to post
/// example of an extra light output to CSV 
Class dc.SQLExport Extends %CSP.Page
{
ClassMethod content() As %Status
{
  set sep=";"
  set sqlStatement="SELECT ...... FROM ....."
    ,query = ##class(%ResultSet).%New()
    ,sc = query.Prepare(sqlStatement)
  set:sc sc=query.Execute()
  quit:'sc sc
  set cols=query.GetColumnCount()
  for col=1:1:cols { if col>1 write sep
    write query.GetColumnHeader(col)
  }
  write !
  while query.Next() {
    for col=1:1:cols { if col>1 write sep
      write query.GetData(col)
    }
    write !
  }
  quit $$$OK
}
/// filename should end with ".csv"
ClassMethod toFile(filename As %String) As %Status
{
  open filename:"WNS":1 
  else   quit $system.Status.Error(5005,filename)
  use filename
  set sc=..content()
  close filename 
  quit sc
}
}
Robert Cemper · Aug 16, 2023 go to post

add this line to your method OnPreHTTP()

 set %response.Headers("Content-Disposition")="attachment; filename=""your-file-name.some"""
Robert Cemper · Aug 15, 2023 go to post

good point:
there are only  17 rules referring to BUGS:

In total the quality check shows 106 rules

So there is more and I personally deeply disagree with some of them

Robert Cemper · Aug 15, 2023 go to post

Not a ready-to-use solution, but a way to take

  1. export the global by SMP or embed %system.OBJ.Export to create *.XML file
  2. download it using <a href="~file_location~" download> explanation
Robert Cemper · Aug 14, 2023 go to post

With JOB you start an independent process in background.
You can pass any variable you may need.
But you can't pass the connection to the CSP page with all its settings.
the connection stays with the foreground job. 

Robert Cemper · Aug 12, 2023 go to post

there is a standard utility %ETN that writes such logs with the stack 
and all other $system variables into the global ERRORs
if you call it by LOG^%ETN it does a kind of snapshot
details here  take a look
 

Robert Cemper · Aug 11, 2023 go to post
  • not usable for Docker Windows Desktop
  • KITVERSION=latest  is just wishful thinking

😒😟

Robert Cemper · Aug 11, 2023 go to post

Are community images from intersystemsdc/  also affected ?

  • this may relate to all templates on OEX
  • and also 430  packages on OEX using docker
Robert Cemper · Aug 9, 2023 go to post

According to class  Class Contatos.Amiguinho you presented
Class Contatos.Empresa should look similar to this to work:

Class Contatos.Empresa Extends %Persistent
{
Relationship Nomedaempresa As 
    Contatos.Amiguinho [ Cardinality = many, Inverse = Trabalho ];

Property Nome As %String;

Storage Default
}
Robert Cemper · Aug 9, 2023 go to post

you may run an export ^%G like on the remote server and then copy somehow the result

Robert Cemper · Aug 9, 2023 go to post

It's an orgy of IsDefined ($DATA) and GetNext( $ORDER) as equivalent of $QUERY is not implemented 

Robert Cemper · Aug 9, 2023 go to post

You just can insert existing IDs.
So you have to check first:

set emp=##class(Contatos.Empresa).%OpenId(IDt)
if $isObject(empDo objcontato.Trabalho.Insert(emp)

Robert Cemper · Aug 9, 2023 go to post

Relationship is an Object concept that has no direct equivalent in SQL to handle it
The "MANY" end is basically just a piece of code ( RelationshipObject) to handle it.
By SQL you just can set it indirectly from the "ONE" end as you found yourself.
This is a real Property / Column that has a distinct value that you can touch and set
 

Robert Cemper · Aug 9, 2023 go to post

Instead of Set  
Set objcontato.Trabalho=##class(Contatos.Empresa).%OpenId(IDt)  
you need to use method Insert()
Do objcontato.Trabalho.Insert(##class(Contatos.Empresa).%OpenId(IDt) 

See Docs