on 10-24-2006 6:20 AM
Hi
I am creating UDF's in OIBT Table.Now i want to change the Datatype SUM to QUANTITY Without removing the Field .(Because Enduser already entered some data's)
Its possible through Coding ?
If yes means pls give some tips to do this.
Thanks
regards
senthilkumar
Hi senthilkumar B
Yes you can, here is a sample function below which does that.
'to call the function
UpdateExistingUDFField("@FRT_OQUT", "U_QTY", "", SAPbobsCOM.BoFieldTypes.db_Float, SAPbobsCOM.BoFldSubTypes.st_Quantity, 11)
'function to update fields
Private Function UpdateExistingUDFField(ByVal TableName As String, _
ByVal FieldName As String, _
ByVal Description As String, _
ByVal Type As SAPbobsCOM.BoFieldTypes, _
ByVal SubType As SAPbobsCOM.BoFldSubTypes, _
ByVal Size As Integer)
Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD
oUserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
Try
If oUserFieldsMD.GetByKey(TableName, 1) Then
'MsgBox(oUserFieldsMD.Name)
oUserFieldsMD.Type = Type
oUserFieldsMD.EditSize = Size
oUserFieldsMD.SubType = SubType
Dim lRetCode As Integer = oUserFieldsMD.Update
'// Check for errors
If lRetCode <> 0 Then
oCompany.GetLastError(lRetCode, sErrMsg)
MsgBox(sErrMsg)
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
'Log.WriteLog("Exception (AddField): " & ex.Message, EventLogEntryType.Error)
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserFieldsMD)
oUserFieldsMD = Nothing
GC.Collect()
End Try
End Function
hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.