web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Help tracing a code related to EDI

(0) ShareShare
ReportReport
Posted on by 5,136

Hello.  I am trying to trace and find out how our invoices/ASNs are sent via EDI automatically in Production but not in Development.  I know the XMLports that are used to create invoices/ASNs as I have modified them myself.  I am also able to test in our test environment but would manually process the invoice which means manually running the XMLPort.  But in production, I am having a tough time tracing the code.  I know there's a field in the sales shipment header that will indicate that the record is an EDI record which I gather is a trigger that this ASN needs to be sent via EDI automatically.  I also know there's a separate Nav service that has to run in production so the invoices/shipments are sent via EDI.   I checked job queues and there are no jobs that will run these xmlports automatically.  I traced the Sales Post codeunit and I don't see any code that will call the XMLPort.

Can anyone help shed some light and direct me as to how to reverse engineer so I can find out how invoices/ASNs are sent automatically via EDI in production?  I have been trying to trace the code but am not going anywhere.  Any insights from you would be much appreciated.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    keoma Profile Picture
    32,729 on at

    some ideas:

    - you could use the OM tools (idyn) to find out where the xmlport is used.

    - you could run sql profiler. maybe you'll get some hints.

    - check codeunit 1: there are some functions that have to do with the nas/job queue

    - add an error message into xmlport trigger, then activate the automatic run and check the windows eventviewer.

  • mbr Profile Picture
    5,136 on at

    Hi Jonathan,

    THank you much for your suggestions.  I did look into codeunit 1 and I think this is the one that runs the EDI Job Processing codeunit which in turns look into each record in shipment header and run the customer's XML Port code.  

    However, I am kinda new with codeunit 1.  I usually schedule my jobs via job queue.

    Can you help shed some light in this function in codeunit 1?

    Nashandler(NASID:Text[260])

    ParamStr := UPPERCASE(NASID);

    REPEAT

     SepPosition := STRPOS(ParamStr,',');

     IF SepPosition > 0 THEN

       Parameter := COPYSTR(ParamStr,1,SepPosition - 1)

     ELSE

       Parameter := ParamStr;

     CASE Parameter OF

       'JOBQUEUE':

         CODEUNIT.RUN(CODEUNIT::"Job Queue - NAS Start Up");

    //EDIW14.04 Start

       'EDI':

         CODEUNIT.RUN(CODEUNIT::"EDI Job Processing");

    //EDIW14.04 End

     END;

     ParamStr := COPYSTR(ParamStr,SepPosition + 1);

    UNTIL SepPosition = 0;

    How does Nashandler get run?  I have heard codeunit 1 is a way to run jobs automatically....but I don't know how it gets run.  Is something calling it?  I know we have an EDI Nav Service that runs in the background. Please help me understand.

  • Verified answer
    keoma Profile Picture
    32,729 on at

    //EDIW14.04 Start

    'EDI':

    CODEUNIT.RUN(CODEUNIT::"EDI Job Processing");

    //EDIW14.04 End

    thats the customization.

    in general cu 1 is run when NAS is started and trigger NasHandler is run. if start param "EDI" is given, then the custom code is run, means cu "edi job processing" is run.

    for details follow

    dynamicsuser.net/.../nav-2103-configuring-nas-to-use-job-queue.aspx

  • mbr Profile Picture
    5,136 on at

    Thank you so much Jonathan! The link definitely helped! I figured out how everything works now.  It's the separate Nas Service that calls the edi job processing code unit.  I guess for optimum performance.  It used to be in the codeunit 1 but was later revised to run on its own.  Whew! It's good to know how everything works now.  Much obliged.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans