cancel
Showing results for 
Search instead for 
Did you mean: 

Create UDF with Structure "TEXT"

Former Member
0 Kudos

Hello,

how can I create an UDF e.g. Description with more than 254 characters, I search for it an there are an solution with a Strukture as text, but how could I create an UDF with the API Object and an Structure Text?

This is my Code today:

Set oUserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)

With oUserFieldsMD

.TableName = "B1C_CRYV"

.Name = "Select"

.Type = SAPbobsCOM.BoFieldTypes.db_Alpha

.EditSize = 11

.Description = "Select"

.Add

End With

thx for regards

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

thx to all people hows help

Former Member
0 Kudos

This is the Solution

Set oUserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)

With oUserFieldsMD

.TableName = "B1C_CRYV"

.Name = "Select"

.Type = SAPbobsCOM.BoFieldTypes.db_Memo

.EditSize = 32767

.Description = "Select"

'.SubType = db_Memo

'.Add

End With

lRetCode = oUserFieldsMD.Add

If lRetCode <> 0 Then

oCompany.GetLastError lErrCode, sErrMsg

MsgBox lErrCode & ", " & sErrMsg

End If

Former Member
0 Kudos

Thats the Error Code SAP Throw:

Invalid item code '1' in Enum 'BoFldSubTypes'. The valid codes are '0'-'', '63'-'?', '35'-'#', '84'-'T', '82'-'R', '83'-'S', '80'-'P', '81'-'Q', '37'-'%', '77'-'M', '66'-'B', '73'-'I'

edy_simon
Active Contributor
0 Kudos

Hi

Alpha is limited to 254 char.

For more use type Memo

regards

Edy

Former Member
0 Kudos

It solved the Problem not to 100% because I don't know whitch property I should take

I occurs an Error when I´m trying to set the EditSize above 254 Charcters

This is the message SAP throw:

- Feldgröße weicht vom zulässigen Bereich ab (1...254)

thx for other regards

Edited by: Gerald Schwarz on Apr 15, 2009 1:32 PM

Former Member
0 Kudos

so try it with subtype as

Set oUserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
With oUserFieldsMD
.TableName = "B1C_CRYV"
.Name = "Select"
.Type = SAPbobsCOM.BoFieldTypes.db_Alpha
.Subtype = db_Memo
.Description = "Select"
.Add
End With

Former Member
0 Kudos

You may use code you have already and set .EditSize to max 32767.

If you need structure as text, use .SubType property.