I had posted on mibuso a while back on how to use two NAS instances to run job queue for unlimited amount of companies. Here is the link
viewtopic.php?f=7&t=22633. You had to purchase an additional NAS user license in order to use it. Dynamics NAV 2009 comes with web service, and you can publish any Code unit or Page by default. You will need to purchase one user but for webservice, but it much cheaper. In this blog, I will show you how to setup JOB QUEUE to schedule to run jobs across companies. The advantages of using Web Services is that you can run multiple jobs at the same time for multiple companies. What I’ve experienced with NAV 2009 Web Service is that once you call a web service function, you can disconnect and Service Tier will finish the job and commit the transaction.
In addition you don’t have to modify any processing/posting jobs that have dialog windows displayed. The Service tier simply ignores them. For example you can run adjust cost report without modifying any objects from Job queue. In addition, the solution I’ve created does not modify any existing objects!!!
You can download the fob and read more about it on my blog.
http://mibuso.com/blogs/ara3n/2009/01/2 ... companies/
Ahmed Rashed Amini
Independent Consultant/Developer
blog:
https://dynamicsuser.net/nav/b/ara3n
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
But I have to think it through though... because when scheduling codeunits through web services ... what about the lack of optimistic concurrency?
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
I've uploaded in here as well
http://sites.google.com/site/ara3nfiles ... edirects=0
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
could you clarify?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
You won't get the message "the record has been changed since you last read it from the table...". No version control.
Or at least, this has been told to me...
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
From webservice.
My test codeunit looked like this.
So while the WS was waiting I modified the description on the item with another client.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I wish a Microsoft dude (freddy? ) would stick his nose into this issue, because also I would like to know the details of it ... .
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
You publish the customer Page, and then create a new Codeunit with function UpdateCustomerPostingGroup and it takes Customer as parameter. In Web Service Table you publish the codeunit with same Name as Customer. And in Visual Studio when you consume the Customer Page you'll see UpdateCustomerPostingGroup as a function to which you can pass the Current Record you are modifying. And that's where you'll see the issue.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
RIS Plus, LLC
Anyway - it is correct that there is no optimistic concurrency and there are several ways to cope with this - not one single answer.
I would love to discuss this, understand the issues you run into and discuss various solutions to these (which we then could post here). Any chance that some of you are going to Convergence in New Orleans? - maybe we could setup a discussion on this topic there?
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
If there is no optimistic concurrency? I wouldn't get the above error, and I wouldn't be able to modify the item record. Web service had to lock the item record when it issued a get.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
We are using optimistic concurrency with no conflict resolution - so if two users modify different fields in the same record, the last user to update gets the error. Web Services here is just like a user.
You can provoke this with 2 clients as well - open 2 clients (Classic or RTC) - open item 1000 in both - modify something in one client and close the card. Modify something in the other client and close the card and you get the error - I guess it has been like that forever.
So the webservice codeunit is the same - the
ITEM.GET
is reading the record and if anything changes the record from that time and until it tries to write the record back - it will fail.
Re-reading the thread - I guess the question is whether or not this applies to codeunits that are published as extention functions to pages - right?
I am pretty sure that it does - meaning that you cannot do like this:
You would have to re-read the Item after calling the Test function, since the extension function gets the key and re-reads a representation of the record itself.
That is at least what I know/have tried - let me know whether there are anything I should try to investigate?
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I'm going to be at Convergence ... and i would love to go into this furthermore
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Nothing is changed at the codeunit RunJob. The only change at the server is a windows update for Internet Explorer 8.
Today the Job Queue Log Entries give me the following error: Http Error 500: Internal Server Error
The event viewer of the server gives me the following error:
Type: Microsoft.Dynamics.Nav.Service.WebServices.ServiceBrokerException
Message: Method "RunJob" is invalid!
Does anyone can give me a clue?
Thanks in advance.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
The webservice is running and accessible and RunJob is published.
Next idea would be to reinstall the server tier.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
viewtopic.php?f=32&t=34672
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
After this I have made a virtual PC with NAV2009 and added the codeunits and the NAS.
The same error occures: Http Error 500: Internal Server Error
The event viewer gives the same error too: Message: Method "RunJob" is invalid!
When have have more time I will try it again. Thanks for your time for now.