cancel
Showing results for 
Search instead for 
Did you mean: 

DI API Wrong way to perform update?

former_member551008
Participant
0 Kudos

This is Probably an easy question for the experienced but that is not me.

Lets say I have a user defined field in oitm

Am I not supposed to do an update as such?

        Dim myRs As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

        Dim sQuery As String = "update oitm set myColumn = 'mynewvalue'where keyColumn = 'uniquevalue'" 
myRs.DoQuery(sQuery) 'update performed

Is this operation ok?

Am I risking my databases integrity?

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Derek Moore,

Indeed, this is the case which is not supported. This will void your SAP Support.

You can refer to following blog post which mentions the Guidelines for Modifying SAP Business One Data.

Guidelines for Modifying SAP Business One Data.

Hope it helps!

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

former_member551008
Participant
0 Kudos

Thank you that is what I was trying to find out.

former_member551008
Participant
0 Kudos

Can you help point me in direction of how i would perform this update the right way?

former_member551008
Participant
0 Kudos
    
        Dim itemMaster As SAPbobsCOM.Items
        itemMaster = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
        itemMaster.GetByKey(ItemToUpdate)
        itemMaster.UserFields.Fields.Item("U_MyField").Value = newValue


How about this sir?
Am I within Guidline now?
ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi Derek Moore,

Yes. This is the correct way to do it.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

former_member551008
Participant
0 Kudos

Thank you so much sir.

-Derek

Answers (0)