cancel
Showing results for 
Search instead for 
Did you mean: 

How to Update a field using DI api

Former Member
0 Kudos

Hi all,

I'm very new to SAP B1 development. So please somebody tell me how to update a particular field in database.

Buddhika.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Say, suppose u want to update a user-field in the Business Partner Master data then u need to do the follwing,

Dim obp As SAPbobsCOM.BusinessPartners
obp = Me.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners)
obp.GetByKey("C0001")
obp.UserFields.Fields.Item("U_Bday").Value = "18-07-1983"

Thats how u update,

For samples plz check the samples provided with the SDK. They are avaliable in the following path C:\Program Files\SAP\SAP Business One SDK\Samples

Hope it helps,

Vasu Natari.

Former Member
0 Kudos

I want to overwrite(by using DI API) the "Payment reference" field in the invoice for a particular customer's Invoice when closing the Payment.Because I'm creating add-on and I want to overwrite my Custom generated ID with the currently shown value in the "Payment Reference" field when opens Invoice window.Then in future, can refer the invoice with corresponding payment.

Thank you.

Former Member
0 Kudos

For that u need to use the oInvoices or the Documents DI objects and update the required value if its exposed by the DI API.

Please check the DI API Help reference file provided in the SDK help folder. That gives u all the information u need.

Hope it helps,

Vasu Natari.

Former Member
0 Kudos

Logical you must use oinvocie document and set property PaymentReference and call oinvoice.update.

The problem is, that this property is readonly and you cannot set it explicitly. So the answer is, that it isnt possible.