Skip to Content

DI: Salesorder GetByKey

Hello,

a obviously simple task, but somehow it is not working:

After the user has successfully saved a sales order I'm trying to get the sales order document with the document number from the form (cust_order_no as Integer):

Dim oOrder As SAPbobsCOM.Documents

oOrder = company.GetBusinessObject (SAPbobsCOM.BoObjectTypes.oOrders)

ret = oOrder.GetByKey(cust_order_no)

GetByKey returns false although the order is in the database.

What is wrong?

DI API 6.7

Regards,

Frank

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 05, 2004 at 09:47 AM

    The order number displayed on the form is not the key.

    The order number displayed on the form maps to the field "DocNum", the key field is "DocEntry". DocEntry is always sequentially generated by the system, whereas DocNum can optionally be manually entered.

    John.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Frank,

      You are thanking a poster for his answer.

      Please next time also give him points.

      See: /people/mark.finnern/blog/2004/08/10/spread-the-love

      This time I did it for you.

      Remember: When you ask a question you also assume the responsibility to assign points.

      Please check your other questions and if the answers were good.

      Spread the love and give some points.

      Thanks in advance, Mark.