Products A-Z All Services Can't find what you're looking for? Chat Live!
Products A-Z Can't find what you're looking for? Chat Live!
Can't find what you're looking for? Chat Live!
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
Hi David,
Thanks for your reply. I implemented your code in C# which is given below , but when im trying to use AddEntry method its unable to add that entry to database . Its always showing "Unable to add entry" . Could you please help me with this. What kind of users can use AddEntry method successfully. I mean what special permissions that user should have to add the entries. Or do i need to make any changes to get this working.
}
The only rights you need are those in admin, security and ensure that you have rights to the code table you are adding to. If you are a supervisor then this should not be a problem.
One thought is that your short description is too long. It has a maximum of 6 characters. In most cases you do not need a short description. It is just a few code tables that actually make use of this (constituent codes, states, countries, etc)
Thanks David. I implemented as you specified and it really worked . It is very much appreciated and in short span of time you replied which is great. I got one more question related to this. Is that possible to check the code table entry before adding . As you said we cannot use GetTableEntryID for codetables which are not in ECodeTableNumbers.
Is there any other way to implement this functionality of check code table entry first exists or not and then add if doesnt exist .
Looking forward for your kind reply