Skip to Content
0
Former Member
Dec 05, 2008 at 09:55 AM

primary key

12 Views

Hi,

Please let me know how can i define the filed primary key.

Let me know what code i have add to make this field as primary key.

Try

oUserFieldsMD = Nothing

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

oUserFieldsMD.TableName = "@PSSIT_PMWCTYPE"

oUserFieldsMD.Name = "typedesc"

oUserFieldsMD.Description = "Type Desc"

oUserFieldsMD.Type = SAPbobsCOM.BoFieldTypes.db_Alpha

'oUserFieldsMD.Mandatory = SAPbobsCOM.BoYesNoEnum.tYES

oUserFieldsMD.EditSize = 60

lRetCode = oUserFieldsMD.Add

If lRetCode <> 0 Then

oCompany.GetLastError(lErrCode, sErrMsg)

MsgBox(sErrMsg)

Else

MsgBox("Field: '" & oUserFieldsMD.Name & "' was added successfuly to " & oUserFieldsMD.TableName & " Table")

End If

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try