Debug NAS

FrekieFrekie Member Posts: 19
edited 2009-05-14 in Navision e-Commerce
Hey all of you.
Is there a way to debug the code executed/triggered thru NAS when working with Commerce Portal.

E.G. I know that there is something wrong with the salesmanagement codeunit. Is it possible to debug that codeunit ?

I was thinking of stopping the NAS Service ans starting it as an application but that did not work.

I know that it is possible to debug Commerce Gateway by stopping the NAS Service and starting Commerce Gateway Single Instance Codeunit. Does that apply to Commerce Portal as well ?

Thx for any hints.

Comments

  • jreynoldsjreynolds Member Posts: 175
    Start NAS from the command line and use the debug parameter.
  • tyrrestruptyrrestrup Member Posts: 10
    I have a codeunit that I start instead of using NAS. That gives you full access to the debugger.
  • naushienaushie Member Posts: 33
    hi
    i dont know my idea will solve your purpose but still i am writing..
    for debugging what i do is write messages in navision code units just like we do generaly .
    and we can see these messages in application Log of system.
    i follow this thing and it always worked for me.
    Naushad Alam
    Consultant -Navision

    All e Technologies (P) Ltd.
    Building Solutions for Extended Enterprises

    www.alletec.com
  • DenSterDenSter Member Posts: 8,307
    Frekie,

    If all that your NAS does is start a single instance codeunit, then yes you should be able to start it from a client session and turn the debugger on. This is generally how you would debug a NAS. If it does more than just start a single instance codeunit, then you'd have to run the server with the debug parameter.
  • lagersjeflagersjef Member Posts: 57
    I have started the nas in debug mode, but that only helps me see messages that I would be able to see in the event viewer anyway.

    What I really want to do is debug inside Navision. I would like to crawl through the code as information is sent through Navision through NAS. (even though I don't have any errors at this time)

    Is there any way I can do this? I am sending information from web and do get a valid response sent back to web, but nothing happens in Navision. ->neither in code coverage nor debugger records any actions...

    I am logged on to the database server and have logged into navision with the same user that NAS logs on with.... working on 3.70

    thanks for any help!
  • alex9alex9 Member Posts: 97
    You can create a table with several text fields and a function which insert data into that table. Put this function in the code everywhere you need and pass it values you're interesting in. Then you can look through the table and analyze what data have been modified while NAS worked.
  • DenSterDenSter Member Posts: 8,307
    Stop the NAS service. Open Navision. Turn on the debugger. Run the codeunits that would normally be run by NAS from the object designer. This should now trigger the debugger and you should see the message received event fired.
  • pduckpduck Member Posts: 147
    alex9 wrote:
    You can create a table with several text fields and a function which insert data into that table. Put this function in the code everywhere you need and pass it values you're interesting in. Then you can look through the table and analyze what data have been modified while NAS worked.

    Be carefully because you must COMMIT the Data so it won't be lost when occuring an error. But such a COMMIT can do things which shouldn't be done in an Error Event :)

    A better way to follow the variable values as in the Event Log may be using this Component I developed?

    http://www.mibuso.com/dlinfo.asp?FileID=532
  • IHateLinuxIHateLinux Member Posts: 223
    Hi,

    my prefered way to debug NAS code is:
    1.) Create a new form
    2.) Create a button on it
    3.) WIth the button click event run a function call to Codeunit 1 - function 99 (NASHandler).

    So for step 3 create a var with type Codeunit and ref to Codeunit 1.

    Then just run: Cod1.NASHandler('YOURNASID');

    Then the client is acting like a NAS and you can use the debugger as usual.

    HTH,
    Rainer
  • DenSterDenSter Member Posts: 8,307
    Oh that is smart. That way, if the NASHandler does more than run one codeunit, you're safe. Good idea :).
  • fanghweifanghwei Member Posts: 4
    this is a good idea, but what does NASID look like?
  • DenSterDenSter Member Posts: 8,307
    NASID is the startup parameter that you are using for your instance of NAS. For Commerce Gateway for instance it is CG, for ADCS it is ADCS, for the job queue it is JOBQUEUE, etcetera.
Sign In or Register to comment.