Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8667

Copy quote to order

$
0
0

I'm trying to copy a quote to order using this code:

 

SAPbobsCOM.Documents cotizacion = (SAPbobsCOM.Documents)SesionActual.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oQuotations);

                if (!cotizacion.GetByKey(docEntry))

                    return false;

                SAPbobsCOM.Documents pedido = (SAPbobsCOM.Documents)SesionActual.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);

 

 

 

 

                pedido.Series = 6;

                pedido.CardCode = cotizacion.CardCode;

                pedido.DocDate = DateTime.Today;

               

                pedido.TaxDate = DateTime.Today;

 

 

 

 

 

 

                pedido.Confirmed = SAPbobsCOM.BoYesNoEnum.tYES;

               

                pedido.TransportationCode = cotizacion.TransportationCode;

                pedido.ShipToCode = cotizacion.ShipToCode;

                pedido.SalesPersonCode = cotizacion.SalesPersonCode;

                pedido.NumAtCard = cotizacion.NumAtCard;

                pedido.ContactPersonCode = cotizacion.ContactPersonCode;

 

 

              

 

 

                for (int i = 0; i < cotizacion.Lines.Count; i++)

                {

                    cotizacion.Lines.SetCurrentLine(i);

                    pedido.Lines.BaseEntry = cotizacion.DocEntry;

                    pedido.Lines.BaseLine = i;

                    pedido.Lines.BaseType = (int)SAPbobsCOM.BoObjectTypes.oQuotations;

                   

                  

 

 

                    pedido.Lines.Add();

                }

                pedido.DocDueDate = DateTime.Today;               

                int res = pedido.Add();

 

 

                if (res != 0)

                {

                    String msgError = "";

                    int msgClave = 0;

                    SesionActual.oCompany.GetLastError(out msgClave, out msgError);

                }

When I add the order I get this error :

 

Internal error (-2010) occurred

 

I don't have any idea about which could be the problem.


Viewing all articles
Browse latest Browse all 8667

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>