When doing an RE7 import you can opt (in code, using an object property, for example) to have table entries created automatically. Is there any way to do this when adding records using the API? Currently the only way I can see how to overcome this is when an error is returned (entry doesn't exist in code table) the record has to be added manually.
There is no automatic add to code tables value in the API. You have to first check to see if the value is in the code table and then if it is not you have to add it. If you are interested I can dig out some code for you.
David
Attribute Type Server which is given in api
But im unable to find whether the value exist in attribute or not. Because GetTableEntryID is asking for ECodeTableNumbers where i cannot find this attribute code table.
Can you help me with this issue.
Code is given below.
BBREAPI7.
oAttributeTypeServer = (rs.CreateServiceObject(BBREAPI7.
oAttributeTypeServer.Init(
{
//here lcodetableid value is 1028 but i cannot find in ECodeTableNumbers class
int
The ECodeTableNumbers enum is just the numbers of standard (not user defined) code tables. You will not find your code table in this enum. However if you want to add an entry to a code table you need to use the following code (you will need to translate the VB.NET to C# but it is pretty straight forward - you will just need to handle the "optional" parameters)
Public Sub addToCodeTable(ByVal shortValue As String, ByVal longValue As String, ByVal codeTable As Integer) Dim tableLookupHandler As CTableLookupHandler tableLookupHandler = _REServices.CreateServiceObject(bbServiceObjects.bbsoTableLookupServer) tableLookupHandler.Init(_SessionContext, _CodeTableServer) oTableLookupHandler.AddEntry(True, codeTable, shortValue, longValue) tableLookupHandler.CloseDown() tableLookupHandler = Nothing
End Sub