on 01-17-2005 4:20 PM
Hi all,
I'd like to know if there is a way to get the ID given to the object saved.
For example, if I save a new Employee, I'd like to get its EmployeeID number.
After I add it (MyEmployeeInfoObject.add) the value MyEmployeeInfoObject.EmployeeID = 0, and not the ID given by Business One.
I know I can find it it the ONNM table, but I can't be sure the EmployeeID retrieve from this table is the one used to add the employee as an other user can add an employee at the same time. I also know that I have to remove 1 to this number because it's the next one available.
That problem is not only for the EmployeeInfo object...
Is there a SQL Server like function "SELECT @@IDENTITY"
Thanks for your help.
Sébastien
After you create an object you can call the oCompany.GetNewObjectCode(ByRef ObjectCode As String) to get the last code of that object:
for example:
...
MyEmployeeInfoObject.add()
Dim strCode As String
strCode = oCompany .GetNewObjectCode(strCode)
MsgBox ("New Object Code = " + strCode)
Ribeiro Santos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
10 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.