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)

How to invoke codeunit 7000 from a web service

(0) ShareShare
ReportReport
Posted on by

Hi,

I'm trying to invoke code unit 7000 from a web service but it does not work. When I invoke it without any parameter the navision service dies.

My question is (are), what are the parameters that I need to pass to it , I cannot find any documentation online about this codeunit.

Aside from creating a web service, is there any other way to calculate prices? I'm looking to a way to get a matrix with all the current prices for all the clients for all the items in the system.

Thank,

Ignacio

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,118 on at

    What is the function you called initially?

    Create another code unit and publish it as a web service.  By using the newly created code unit  calls the functions in the code unit 7000 and pass the parameters to code unit 7000 via that.

  • Community Member Profile Picture
    on at

    Hi,

    Thank for your quick response. I'm not calling any function. Do not know the name of any.

    When I access pages from web services I usually call the web service with no parameter and the service returns the list of methods available. I was trying to do the same with the codeunit.

    Do you have any suggestion of what is the best way to get a matrix of customer/products prices?

    Thank,

    Ignacio

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    i tried following:

    published codeunit 7000 as web service in nav with name SalesPriceMgmt

    soap url: http://<server>:7047/DynamicsNAV80/WS/CRONUS%20Ltd./Codeunit/SalesPriceMgmt

    then i created a c# project, added that url as web reference.

    and ... your are right. nothing. no published methods.

    i checked then the codeunit.

    the reason is: most of the function interfaces contain at least one parameter with datatype record. it's not possible to publish those functions as web service method. to access these functions you'll need to write your own cu with functions, which have only parameters of simple datatype. to get a kind of record datatype in those interfaces you could create an xmlport per record/table and publish that xlmport instead.

  • Community Member Profile Picture
    on at

    Hi,

    It does makes sense, maybe the route of using codeunit 7000 is not the best. Maybe it would be better if I create a wrapper around it and call it from the web service instead.

    Is this doable?

    Thank,

    Ignacio

  • Suggested answer
    keoma Profile Picture
    32,729 on at

    exactly that was my suggestion. write your own codeunit and publish only the needed functions using paramters with simple datatypes. in these new functions then call the functions of cu 7000.

    for usage of xmlports in web services follow e.g. kauffmann.nl/.../how-to-use-xmlports-in-web-services-1

  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,118 on at

    Or else you can write a very small codeunit which will call the functions in the 7000 codeunit.

    In your own codeunit you can filter the related records and pass it to 7000 codeunit functions.

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)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans