Options

How to Handle NAV WorkDate in WebServices

companycompany Member Posts: 89
edited 2010-05-31 in NAV Three Tier
Hi all,

In Navision when we use WorkDate it returns the Date which we enter in Tools --> WorkDate.
But when we use WorkDate in .NET Web Application using Web Services it is returning the Server systems Today's Date.
I also tried using a variable like i have assigned WorkDate to a variable and used that variable through webservices but also same problem repeats.

can any one help me.

Thanks in advance.

Comments

  • Options
    rdebathrdebath Member Posts: 383
    Err? Do you mean this:
    WORKDATE := "Posting Date";
    
    The Workdate variable (function) is just a kind of 'super global', set it to whatever you need.
  • Options
    companycompany Member Posts: 89
    hi robert,

    Thanks for the reply.

    The answer you have give is not the answer for the question i have asked , i think you haven't understood my question.

    Actually my question is i couldn't use the WORKDATE in navsion as it is in Web application.
    i.e for example i have written a function in navision where it filters as below:

    Cust.SETFILTER("Date Filter",'..%1',WORKDATE);
    and i am calculating the balance due within that date filter.When i run this function navision i am getting the correct value but when i run this function from the web application i am not getting the correct value as the web application is not considering the workdate in the navision client but it is considering todays date i.e if the WORKDATE = 02/02/11 and todays date is 05/31/10 it is considering 05/31/10 due to which i cannot get the same value in web as it is in navision.

    So can any one please help me.

    thanks in advance.
  • Options
    rdebathrdebath Member Posts: 383
    The Navision webservice setups up a new instance of the "Navision Environment" for every webservice call.
    Think of is as starting a new copy of the client for every call. If you have two clients running on a PC and change the workdate in one of them the other is unchanged, same with webservices.

    If you want to preserve something between calls you'll have to write yourself some session management routines to save your session data into the database. Of course, it's supposed to be best if web service calls are idempotent.
Sign In or Register to comment.