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

I have too many problems with UserKeyMD Object

Hi everybody!!!......

I've too many problems with UserKeyMD object, this don't work, I have a Application which create the DataBase structure, but when try it for create the user key on "x" field in "ABC" table (x field is present on table, is db_Alpha with 8 chars, subtype is st_None) is raised the problem.

I try to create this way the key (VB example):

Dim oUserKeysMD As SAPbobsCOM.UserKeysMD

Set oUserKeysMD = oCompany.GetBusinessObject(oUserKeys)

oUserKeysMD.TableName = sTableName

oUserKeysMD.KeyName = sKeyName

oUserKeysMD.Unique = BoYesNoEnum.tYES

oUserKeysMD.Elements.ColumnAlias = sFieldName

oUserKeysMD.Add '<- here problem is raised

System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserKeysMD)

I'm work in Delphi .Net and translate the source code of my function to VB.

P.D.:this source code at least work 2 times, but does not use it until today, I do not know because no longer it works now but.

excuse my ingles is very bad

thanks

regards

Francisco Troncoso

Chile.

Message was edited by: Francisco Troncoso

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2005 at 10:11 AM

    Hi Francisco,

    Assuming that you dont have any other living object before you assign the user key, you have to add the following line after releasing the object:

    oUserKeysMD = Null

    Then the object will be completly reseted. If you have any other living object like Userfields or usertables, you will have to release them first.

    Hope this helps,

    Felipe

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.