Skip to Content
Apr 23, 2015 at 11:05 AM

Insert amount in the udf


Dear Experts,

I would like to insert amount to a udf in delivery order using sdk.

here is my code:

Private Sub delivery_update(ByVal DocDate As Date, ByVal sDeliveryOrderDocEntry As String, ByVal sDeliveryOrderDocNum As String, ByRef IsError As Boolean, ByVal SBO_Application As SAPbouiCOM.Application, ByVal oCompany As SAPbobsCOM.Company) Dim oRec As SAPbobsCOM.Recordset oRec = CType(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset), SAPbobsCOM.Recordset) Dim lRetCode As Integer = 0 Dim lErrCode As Integer = 0 Dim sErrMsg As String = "" Dim CustomCode As String = "" Dim VarianAmnt As Decimal = 0 ' GetVariant amount DO and SO oRec.DoQuery("exec GetValueVariantDOSO """ + CustomCode + """,""" + sDeliveryOrderDocNum + """") VarianAmnt = oRec.Fields.Item("VariantAmount").Value.ToString

'----------------------------Delivery ORder -------------------------------------------------- Dim oItemReval As SAPbobsCOM.Delivery Dim isLineExist As Boolean = False oItemDO = CType(oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryOrder), SAPbobsCOM.DeliveryOrder) oItemDO.UserFields.Fields.Item("U_VarianSODO").Value = sDeliveryOrderDocNum.ToString

Pls help how to do that

Thank you