cancel
Showing results for 
Search instead for 
Did you mean: 

UoM error Inventory Transfer with DI API

Former Member
0 Kudos

Good day experts, I'm doing tests in .net with a code that generates a stock transfer using DI API, taking the information from a GridView loaded with a DataTable like this:

I specify the article code, the total amount of the line, lots, etc. In most cases it works correctly and generates the document without problem, but there are certain items that generate an error in the selection of batchs by handling an alternative unit of measurement. I explain, the problem in particular I have it with some boxes of tubes, where the code of the article represents a single tube piece, but when activating the alternative unit, for each "box" it take "x" number of tubes, as in the following example:

When wanting to generate a stock transfer with this information I get the following error: Error: Can not add row without complete selection of batch / serial numbers | Error code: -4014 I was looking for properties in the group "Lines" and "BatchNumbers" but I can not find the solution. I also add the fragment of the code in C # that builds the lines in case it can contribute something to the case:

foreach(DataRow dr in Shared.lotesTransferencia.Rows)
{
    if(i != 0)
        nuevaTransferencia.Lines.Add();

    nuevaTransferencia.Lines.SetCurrentLine( Int32.Parse( dr["NumLineaArticulo"].ToString() ) );
    nuevaTransferencia.Lines.ItemCode = dr["Articulo"].ToString();
    nuevaTransferencia.Lines.Quantity = double.Parse(dr["Total"].ToString());
    nuevaTransferencia.Lines.WarehouseCode = ddlAlmacenDestino.SelectedItem.Text;

    // Prueba para unidad de medida
    nuevaTransferencia.Lines.UseBaseUnits = BoYesNoEnum.tNO;
    nuevaTransferencia.Lines.MeasureUnit = dr["UnidadMedida2"].ToString();

    nuevaTransferencia.Lines.BatchNumbers.SetCurrentLine( Int32.Parse( dr["NumLineaLote"].ToString() ) );
    nuevaTransferencia.Lines.BatchNumbers.BatchNumber = dr["Lote"].ToString();
    nuevaTransferencia.Lines.BatchNumbers.Quantity = double.Parse( dr["Cantidad"].ToString() );
    nuevaTransferencia.Lines.BatchNumbers.Add();

    i++;
}

Has anyone had a similar problem? I thank you in advance for any comments or guidance you may give me. Best regards.

Former Member
0 Kudos

Thank you for the comment, I update the tag to SDK and asp.net only. Sorry for the trouble.

Regards.

Accepted Solutions (0)

Answers (0)