I started to write a general framework for accessing Navision data from outside with firing triggers. You just drop something like this into MSMQ or, better yet, a web service:
<Modify RecordID = "Customer: Cust001" CallOnModify="True" RequestID="5FS4WG4WW-FW4TRWFWW3343-DWW343434-43W4WRW">
<Field FieldNo="2" CallOnValidate = "True">Forrester Ltd.</Field>
<Field FieldNo="5" CallOnValidate = "True">Baker street 23</Field>
</Modify>
and you have updated a record. And same stuff for inserting, reading etc. I will publish it when it is finished, but I have some problems.
1. How should I handle locking? I'd like to avoid a SingleInstance CodeUnit, because that keeps throwing internal errors (4.0SP1), but without that, what else could maintain a lock between a reading and a modifing request?
2. How should I route answering to requests? It seems the client application will need at least two threads, one of them collecting answers from MSMQ and saving them, the other thread - that initiated the requests - will wait and periodically search the answers for it's RequestID to find something like "Modify OK" to know the operations has finished successfully. Is there an easier way for it?
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
http://www.BiloBeauty.com
http://www.autismspeaks.org
Very hard... if you want to do more request in one transaction, you do not have another solution than collect the requests into some buffer and after zou know, that the transaction is prepared (you have something like EOT in the message queue) you need to process the buffer in one run.
Which internal error do you mean? How you are calling this codeunit? If you call it from CU1, you need to check if the CU is defined as global or local.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I think we can safely assume that
1) In Nav5 it will not be implemented in pure C/AL, but also the fin.exe will be extended, which means if it has errors, which are usually plenty, we will not be able to fix it
2) it will cost extra money
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Basically, the problem is that while PHP properly instantiates the OutMessage COM object returned by CreateoutMessage into $outMsg, it does not instantiate the COM OutStream object returned by GetStream(); into $outStream. $outStream becomes a zval (a generic, undefined PHP type) instead, and as it of course does not have a WRITE method, it fails.
Fatal error: Call to a member function WRITE() on a non-object.
Be patient Miklos for nav 5.0.
Besides, I don't think they would explicitly make it easier to send in data from non-MS languages, it's not their style, isn't it?
:whistle:
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Because if you go to NAV 5.0 before any service packs, you will likely face a huge cost once SP1 and then again once SP2 comes out to upgrade your NAv5.0 database.