cancel
Showing results for 
Search instead for 
Did you mean: 

Di Error - Exception: -5001 - Object type for draft is missing

Former Member
0 Kudos

Hi Experts.

Has anyone encountered this error?  "Object type for draft is missing".


StockTransfer stDraft = (StockTransfer)oSup.oCompany.GetBusinessObject(BoObjectTypes.oStockTransferDraft);

            try

            {

                stDraft.CardCode = transferencia.ParceiroDeNegocio;

                foreach (var item in transferencia.ListaItens)

                {

                    stDraft.Lines.FromWarehouseCode = item.Deposito;

                    stDraft.Lines.ItemCode = item.ItemCode;

                    stDraft.Lines.Quantity = item.Quantidade;

                    stDraft.Lines.BinAllocations.BinActionType = BinActionTypeEnum.batFromWarehouse;

                    stDraft.Lines.BinAllocations.BinAbsEntry = item.Posicao;

                    stDraft.Lines.BinAllocations.Quantity = item.QtdPosicao;

                    stDraft.Lines.BinAllocations.Add();

                    stDraft.Lines.Add();

                }

                int iRetorno = stDraft.Add();

                if (!iRetorno.Equals(0))

                {

                    string sErro = oSup.oCompany.GetLastErrorDescription();

                    throw new Exception(sErro);

                }

            }

            catch (Exception)

            {

               

                throw;

            }

Accepted Solutions (1)

Accepted Solutions (1)

former_member413321
Contributor
0 Kudos

Maybe this can help.

Former Member
0 Kudos

Thanks Alejandro.

Answers (0)