Skip to Content
author's profile photo Former Member
Former Member

Definining user field with LinkedTable property

I'm trying to add a user field to the OITM table linked with a user table named XX_SECC with this code (SDK 6.5):

Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD

Set oUserFieldsMD = oCompany.GetBusinessObject(oUserFields)

oUserFieldsMD.TableName = "OITM"

oUserFieldsMD.Name = "XX_SECC"

oUserFieldsMD.Description = "Seccion"

oUserFieldsMD.Type = db_Alpha

oUserFieldsMD.EditSize = 15

oUserFieldsMD.LinkedTable = "XX_SECC"

lRetCode = oUserFieldsMD.Add

If lRetCode <> 0 Then

oCompany.GetLastError lErrCode, sErrMsg

MsgBox "OITM:" & sErrMsg

End If

and I obtain the error 5002 with this description:

"The field 'Related Table' should consist of 8 alphanumeric characters with no valid or default values [UFD1]"

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 05, 2004 at 03:45 PM

    Change the EditSize of your field to 8.

    When using linked tables the value that is actually linked to is the "Code" field on the user defined table - this is always 8 characters in size.

    Regards,

    John.

    Add comment
    10|10000 characters needed characters exceeded