on 08-05-2004 10:39 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It can get even more interesting than that if you are dealing with adding new documents.
"retrieve docnum through UI-api" sounds rather easy. You need to remember that the DocNum displayed on screen while you are entering an order isn't necessarily the docnum that ends up on the sales order when you add it.
Potentially if you are using automatically generated numbers, another user may have added a new sales order while you were typing the details into the screen. Their order would have the same DocNum as yours displayed when they were entering it, and would get that number allocated to their order when they saved it. When you save your order, business one will allocate the next available docnum from the series and it will then display a message in the status bar telling you the actual document number it used.
Make sure you watch out for that one.
Regards,
John.
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.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.