cancel
Showing results for 
Search instead for 
Did you mean: 

How to Create UDF to ORDR table Using SDK ?

Former Member
0 Kudos

Plz help Me..?

View Entire Topic
Former Member
0 Kudos

Private Sub AddUserField()

Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD

Set oUserFieldsMD = oCompany.GetBusinessObject(oUserFields)

oUserFieldsMD.TableName = "ORDR" '// Sales Order table

oUserFieldsMD.Name = "SO_UserField1"

oUserFieldsMD.Description = "A user field"

oUserFieldsMD.Type = db_Alpha '// am alphanumeric type

oUserFieldsMD.EditSize = 20

oUserFieldsMD.Add

End Sub

Former Member
0 Kudos

Dear all,

Just 2 additions to Bryan's answer:

  • No instance of any DI'sobject (except Company and UserFieldsMD) have to exists in the addon memory space while Bryan's code is executed,
  • Don't forget to call Marshal.FinalReleaseComObject for the oUserFieldsMD object before leaving the sub, else you're in trouble for the next calls.

Regards,

Eric