I have an ECL with a non-emissive series and I intend that at the time of writing it, another CECL sales document with an emissive series is created. The documents are exactly the same.
The code below gives the following error:
The [2017] series of the [CECL] document has documents certified by a different application than the current one. To save the document you will need to create a new series.
Note: There is no CECL document yet. Note 2: I did not want to pass field by field and line the line from the original document to the destination. I think that's not necessary.
Dim newDoc As New GcpBEDocumentoVenda
Set newDoc = Me.DocumentoVenda
newDoc.Tipodoc = "CECL"
newDoc.EmModoEdicao = False
BSO.Comercial.Vendas.PreencheDadosRelacionados newDoc, PreencheRelacaoVendas.vdDadosTipoDoc
BSO.Comercial.Vendas.Actualiza newDoc