Good morning,
As Sergio said in his comment, it is important to have an example code here so that everyone can see the point well.
Even without a code, as I understand it, what you want here is that you do not release the substitute article in the AddLine method. This can be done through the argument AdicionaArtigoAssociado
, passed to false
.
I leave here the API of this method of v10, in v9 it's all identical.
CmpBEDocumentoCompra AdicionaLinha(CmpBEDocumentoCompra clsDocCompra, string Artigo, ref double Quantidade, ref string Armazem, ref string Localizacao, double PrecoUnitario, double Desconto, string Lote, double QntVariavelA, double QntVariavelB, double QntVariavelC, double DescEntidade, double Desc, int Arredondamento, int ArredondaIva, bool AdicionaArtigoAssociado)
The documentation can be found here.