Pedro Lopes · Sep 4, 2023 go to post

Hello Ashok Kumar

I may not have explained the problem correctly.

The program "PropList" works when used directly in the terminal, but when used from the CSP it also works partially, except for the SELECT that is in the program.

Everything works perfectly when I use the same CSP code in the "USER" namespace.

Pedro Lopes · Aug 9, 2023 go to post

There is only one Property at Contatos.Empresa

Property Nomedaempresa As %String;

Pedro Lopes · Aug 9, 2023 go to post

 s emp=##class(Contatos.Empresa).%OpenId(IDt) If $isObject(emp) Do objcontato.Tr
                                                                ^
abalho.Insert(emp)
<INVALID OREF>C+5^cont
USER 2d0>zw
 
IDt=1
NInd="NomeIndex"
emp=<OBJECT REFERENCE>[2@Contatos.Empresa]
objcontato=<OBJECT REFERENCE>[1@Contatos.Amiguinho]
pakobj="Contatos.Amiguinho"

Pedro Lopes · Aug 9, 2023 go to post

Do objcontato.Trabalho.Insert(##class(Contatos.Empresa).%OpenId(IDt))
 

Pedro Lopes · Feb 10, 2023 go to post

Simple and perfect, I just added "ORDER BY SequenceNumber" to suit my needs. Thanks