Good morning!
I'm writing a web service and matching client in VB .NET.
I need to update some Axapta tables from the web service. I don't want to directly access the SQL tables (fine for reading but recId becomes a problem when writing new records).
I'd really like to do it properly and interface with Axapta using COM. Which requires some useful Axapta-side classes to interface with the tables in question.
The problem is I don't have the class license for Axapta !
So I guess what I'd love to know is :
1. Is there some existing class in Axapta that allows me to write arbitrary data to an arbitrary table (while automatically populating recId) ?
2. Does recId have to be unique across all tables in Axapta? By this I mean is it illegal for a record in, say InventTable to have the same recId as a record in PurchTable?
Or must recId be unique only within a table? Could I write a straight SQL statement which locks the table, looks at the most recent recId and adds 1 to it?
3. Any other ideas as to how I can achieve my goal ?
Thanks in advance for any help. Before long I hope to have enough knowledge to actually help other people with Axapta queries!
Lee
0
Comments
Then I'll do an old-fashioned SQL insert using that recId.
Could anyone comment on the validity of this plan ?
My blog - http://kashperuk.blogspot.com
MorphX IT in Russian - http://www.lulu.com/content/723888
Inside Dynamics AX 4.0 in Russian - http://www.ozon.ru/context/detail/id/3714582
If you are using Ax 3.0 pre SP5 and are trying to insert records into virtual company, please read ahead.
A while ago I remember reading about a bug in Ax 3.0 (prior to SP5) involving reserveValues method.
Apparently if you are trying to insert records into Ax virtual company table, recIDs were drawn not from the virtual company table but from the current company account.
I believe this was fixed in SP5.
Regards,
Long way to go before I sleep..
If anyone else if trying to do the same thing, I got this code from Onno on MS's Dynamics forum. It lets you insert arbitrary code into an arbitrary table via COm and takes care of RecId automagically: