NAV web services and static codeunits

Cem_KaraerCem_Karaer Member Posts: 281
edited 2012-04-10 in NAV Three Tier
Hello,

I have a static codeunit to retain a global dimension throughout one NAV classic client session so as to isolate departmental transactions. For instance, a form sets the departman dimension and any other object gets this setted dimension via the static codeunit but.. But NAV webservices do not utilize static codeunits as I expected.

I publish a codeunit, and use a function of it in my third party application. The function of the published codeunit sets "the global variable" and makes sales price calculations and sales postings. Sales price calculation have been customized to reflect departmental differences by using "the global variable". But price calculations yield wrong prices because we can not set "the global variable".

I know that there is an analysis and design problem but we can not change it for now. Does anybody know any workaround solution for using static codeunits in web services?
Cem Karaer @ Pargesoft
Dynamics NAV Developer since 2005

Comments

  • mihail_kolevmihail_kolev Member Posts: 379
    I'd use a setup table, where I can store these global values.
    -Mihail- [MCTS]
  • Cem_KaraerCem_Karaer Member Posts: 281
    I'd use a setup table, where I can store these global values.

    What should be the primary key of the setup table? It must contain a service call ID, if exists any, so that any service call should be able to set and then find its global variable.
    Cem Karaer @ Pargesoft
    Dynamics NAV Developer since 2005
  • mihail_kolevmihail_kolev Member Posts: 379
    I think you answered your question while asking. The primary key is defined by your needs. Sounds like you want to generate some GUID for every service session, the you can call some set function with this GUID and use it as primary key of your table.
    -Mihail- [MCTS]
Sign In or Register to comment.