Utility of recid

Is it possible to load data into standard axapta table (ie:InventTable, CRM Tables,…) directly in sql server ? May i manually generate the recid in the table or is it necessary to do that inside Axapta application to keep data integrity ? Application should be re-indexed after recid being modified ? Thanks in advance. Regards.

There should not be any problems. We have made imports directly into (Oracle)database; data was originally generated from a backup including recid’s. You have to generate recid’s yourself - and see that the recid’s are unique. Reindex? Should not be necessary but - try it out!

Thanks a lot. I ask to reindex because the dev best pratices Hand Book (http://technet.navision.com/usered/BPH/DevBestPractices/Dev_BPHB.htm subject ‘RecId’) says: "If the table is not given a unique index (since there is no key in the application), the system will create a unique index anyway (to actually get a key). The index will consist of the fields in the shortest index definition, measured in bytes, appended with the recId. " So the application table indexes maybe based on the recid.

Hi Sebych, I would - in contrast to AnFinnur - not recommend to generate RecID’s outside Axapta (if I understood you correctly, that’s what you want / need to do). The point is that AFAIK in V3.0 in several tables the highest (latest) RecID is stored (AFAIK in 2.5 this was only one table). If you generate RecID’s outside Axapta, the system will not update those tables. Now when users generate Records inside Axapta afterwards, there’s a high probability that some of them will not be unique. Another problem potentially is the algorithm of the generated numbers, as they are no autonumbers, and the algorithm is not something like newnumber = oldnumber-1 So AFAIK you have to write the App inside of Axapta Greetings Patzerkoenig

Hi,Sebych I agree patzerkoenig’s point,you should not generate RECID outside Axapta. Recid,CreateDate …etc inherit form Common table, its controled by Axapta system. and infact Recid is not only use for index,RECID is also unique ID in Axapta system. I think there are two ways to meet your requirement. 1,use excel template. access from adimistratoion/periodic/data export/inport. 2,create a temp table outside axapta in axapta database,eg,Tmp_Inventtable, then import your data to this table outside axapta.At this moment,you can access Tmp_inventtable directly inside axapta,but you can create a connection object to access it. eg. connection con=new connection(); ResultSET R; ; R=stm.executeQuery('select * from Tmp_inventtable order by itemid '); while (R.next()) { //insert table here. } the above words are my opinions, just for you reference. best regard. Andy.PengQingHua from china.

Hi everyone, After discussing with developers, end-users and members of official support of my country, Axapta application indexes are really based on both recids and primary keys of database tables. I’m not sure but i think that the recid is also used by the system to keep data integrity and operate locks (optimistic, pessimistic,…) and simultaneous access on tables. Thus, the right ways seems to be what explain hua. Thanks to all. Have a pleasant day.

Hi, How much data are you planning to import into Axapta? If it is going to be a large import, then plan the import carefully otherwise you would be wasting RecIds. Since RecIDs are unique per company it would make much sense if you store your Temp tables in a separate company rather than storing them in your main company. Alternatively use default data import mechanism or better, write jobs to import data into Axapta. This way you can avoid unnecessary complications involved - unless you have some special reasons of course :slight_smile: Thanks, Harish Mohanbabu