I needed to use this functionality, but in the purchasing module. I'm not in the Editor, but in form
, so I can not use Me.DocumentoCompra
.
For this I am editing the document that I want to clone, invoking the function ClonaObjecto
. I hit Tipodoc
and update but is giving an error:
0: Unspecified error
What is the correct way to do this?
Dim objCopia As GcpBEDocumentoCompra
Set objCopia = New GcpBEDocumentoCompra
Dim objOrig As GcpBEDocumentoCompra
Set objOrig = Aplicacao.BSO.Comercial.Compras.Edita("000", "FPD", "2018", "8")
'Clona o objeto de origem
Set objCopia = PSO.FuncoesGlobais.ClonaObjecto(objOrig)
objCopia.TipoDoc = "FD"
BSO.Comercial.Compras.Actualiza objCopia
BSO.Comercial.Compras.Actualiza objOrig