cancel
Showing results for 
Search instead for 
Did you mean: 

add userfields to document ?

Former Member
0 Kudos

hi,

does anybody knows how i can add userfields to documents by DI ? Some code snipets would be nice.

thanks

Markus

Accepted Solutions (1)

Accepted Solutions (1)

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

You should use the object UserFieldsMD object to add userfields to a system table.

You must know the name of the table representing your document and then follow the code I show you here:

Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD

'// the meta-data object needs to be initialized with a

'// regular UserFields object

oUserFieldsMD = pCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)

'// Setting the Field's mandatory properties

oUserFieldsMD.TableName = "TABLENAME"

oUserFieldsMD.Name = "MyFieldName"

oUserFieldsMD.Description = "My Field Description"

oUserFieldsMD.Type = SAPbobsCOM.BoFieldTypes.db_Alpha

oUserFieldsMD.EditSize = 20

'// Adding the Field to the Table

lRetCode = oUserFieldsMD.Add

Hope it helps

Trinidad.

Former Member
0 Kudos

hi Trinidad,

it works with system table.

thanks for help

Markus

Answers (0)