cancel
Showing results for 
Search instead for 
Did you mean: 

Creating purchase order through coding

Former Member
0 Kudos

I am trying to create purchase order through Code, for a table field i can insert as :

odocs = GOD_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)

odocs.CardCode = "200173"

But if the field is not a table field then , how can i insert it in PO?????

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184566
Active Contributor
0 Kudos

Hi Ashish Patil

Not sure what you mean, not sure what table you are talking about. But here is some sample code on how to add a purchase order.

Dim PO As SAPbobsCOM.Documents

PO = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders)

PO.CardCode = "VUL001"

PO.Lines.ItemCode = "02SILVTS"

PO.Lines.Quantity = 1

PO.Lines.Price = 120

If PO.Add() <> 0 Then

Dim str As String

str = oCompany.GetLastErrorDescription()

MsgBox(str)

End If

hope it helps

Former Member
0 Kudos

Hello Ashish,

What do you mean by not a table field?

Do you mean user defined field?

If it is, you need to use UserField property of the business object.

Hope this helps,

Nick He