go to post Cristiano Silva · Aug 2, 2017 Hi Pravin, You can create a custom task and disable the journal in the beginning of the method with this line: DO DISABLE^%NOJRN Put yor purge logic and then in the end of code you can enable again the journal with: DO ENABLE^%NOJRN These lines affect only the current process. Regards
go to post Cristiano Silva · Aug 2, 2017 Hi Joost,Try to use tha delegation action, maybe is that what you need.http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.SearchPageZen...Regards.
go to post Cristiano Silva · Jul 31, 2017 His,It looks like the record you are trying to access does not conform to the global mapping of the class.Make a comparison with the global data of a record that is returned in the query and with this one that is giving problem, so maybe you can see if there is any piece of record that returns error is in disagreement with the global mapping of the class. Regards.
go to post Cristiano Silva · Jul 27, 2017 Hi EvgenyCould you send me a join code?RegardsCristiano José da Silva
go to post Cristiano Silva · Jun 1, 2017 Hi Javier, A some years ago I wrote a class to copy from to object. Is a simple data tranformation that reads the definition of source object and try to set the target object. Is a very simple copy, without care about with types, I use for save time when I need to copy many properties of source object to target object. Recently I adapted the code to consider the source objects that are dynamic objects. Works similar to the method from JSON that Chris wrote in the post. The code was written in portuguese (Brazil) I hope can be useful to you. /// <p> /// <b>2012-03-01 - Cristiano José da Silva</b><br/> /// Classe utilizada para copiar todas propriedades de um objeto origem para um objeto destino.<br/> /// Esse método não se comporta como o %ConstructClone, pois ele copia os dados de origem para um /// destino mesmo sendo de tipos diferentes. Ele foi implementado para poder copiar objetos de tipos /// diferentes mas com a mesma definição.<br/> /// A definição mandatória é a da origem, isto é, caso o objeto destino possua um referência para outro /// objeto, e no objeto origem essa mesma propriedade seja uma string, o objeto destino receberá uma string /// no lugar de uma referência.<br/> /// Caso queira ignorar uma ou mais propriedade passa-las em no array pProriedadesAIgnorar indexao pelo nome /// da propriedade Ex: /// <example> /// Set tPropriedadesIgnoradas("Prop1") = 1 /// Set tPropriedadesIgnoradas("PropN") = 1 /// </example> /// <strong> /// Os nomes das propriedades devem ser exatamente iguais nas duas classes.</br> /// Os tipos também devem ser os mesmos para evitar erros. /// </strong><br/> /// </p> Class cjs.dt.CopiarObjetoDT Extends Ens.DataTransform [ ProcedureBlock ] { ClassMethod Transform(pSource As %RegisteredObject, pTarget As %RegisteredObject, ByRef pProriedadesIgnoradas) As %Status { #Dim tException As %Exception.General #Dim tStatus As %Status = $System.Status.OK() Try { If ($IsObject($Get(pSource)) '= 1) { Set tStatus = $System.Status.Error(5001, "Objeto origem é obrigatório") // Quit } If ($IsObject($Get(pTarget)) '= 1) { Set tStatus = $System.Status.Error(5001, "Objeto destino é obrigatório") // Quit } // Trata Objetos Dinâmicos (JSON) If (pSource.%IsA("%Object")) { #Dim tIterator As %Iterator.AbstractIterator = pSource.$getIterator() #Dim tChave As %String = "" #Dim tValor As %String = "" // While (tIterator.$getNext(.tChave, .tValor)) { If ($Data(pProriedadesIgnoradas)) { Continue:($Get(pProriedadesIgnoradas(tChave), 0)) } Set $Property(pTarget, tChave) = tValor } } Else { Set tDefinicaoClasse = ##Class(%Dictionary.CompiledClass).%OpenId(pSource.%ClassName(1)) #Dim tPropriedades As %ArrayOfObjects = tDefinicaoClasse.Properties #Dim tIndicePropriedade As %Integer = 0 // For tIndicePropriedade = 1 : 1 : tPropriedades.Count() { #Dim tPropriedade As %Dictionary.CompiledProperty = tPropriedades.GetAt(tIndicePropriedade) // Continue:(tPropriedade.Private || tPropriedade.ReadOnly || tPropriedade.Calculated || tPropriedade.Transient) // #Dim tNomePropriedade As %String = tPropriedade.Name // If ($Data(pProriedadesIgnoradas)) { Continue:($Get(pProriedadesIgnoradas(tNomePropriedade), 0)) } Set $Property(pTarget, tNomePropriedade) = $Property(pSource, tNomePropriedade) } } } Catch (tException) { Set tStatus = tException.AsStatus() } Return tStatus } ClassMethod Teste() { Write !, "Teste ambos sendo um objeto registrado", ! // Set tOrigem = ##Class(Ens.StringContainer).%New() Set tOrigem.StringValue = "Ambos registrado." Set tDestino = ##Class(Ens.StringContainer).%New() // Do ..Transform(tOrigem, tDestino) // Write tDestino.StringValue, ! Write !, "Teste da origem sendo um objeto dinâmico", ! // Set tOrigem = ##Class(%Object).%New() Set tOrigem.StringValue = "Origem dinâmico" Set tDestino = ##Class(Ens.StringContainer).%New() // Do ..Transform(tOrigem, tDestino) // Write tDestino.StringValue, ! Write !, "Teste da destino sendo um objeto dinâmico", ! // Set tOrigem = ##Class(Ens.StringContainer).%New() Set tOrigem.StringValue = "Destino dinâmico" Set tDestino = ##Class(%Object).%New() // Do ..Transform(tOrigem, tDestino) // Write tDestino.StringValue, ! Write !, "Teste ambos sendo um objeto dinâmico", ! // Set tOrigem = ##Class(%Object).%New() Set tOrigem.StringValue = "Ambos dinâmico" Set tDestino = ##Class(%Object).%New() // Do ..Transform(tOrigem, tDestino) // Write tDestino.StringValue, ! } }
go to post Cristiano Silva · Mar 15, 2017 Hi Timothy,Other way is to create a project then export only the compiled code and import in the namespece where you wanto to deploy.http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=ADEPLOYBest Regards,Cristiano José da Silva
go to post Cristiano Silva · Sep 27, 2016 You can looking for the host variable %ROWID that has the last id of the row afected by a INSERT/DELETE/UPDATE.http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_esql#GSQL_esql_pcROWIDAnother way is the function LAST_IDENTITYhttp://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_last_identity