Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Create webservice in NAV2018 to use in external app, return JSON with item information

Posted on by 2

Hi All,

I need to create a webservice in NAV 2018 to be used in an external app. The webservice is called for a specific item number, the webservice should return a JSON with some relevant information of this specific item.

I have a hard time finding a good example which is covering this issue, can anybody provide me a simple example?

Thanks in advance,
Yannick

  • Suggested answer
    Jyotsna NAV Profile Picture
    Jyotsna NAV 585 on at
    RE: Create webservice in NAV2018 to use in external app, return JSON with item information

    Ok.. no problem.

    See it this thread helps you. 

    https://community.dynamics.com/business/f/dynamics-365-business-central-forum/289733/multiple-layers-json-reading/830739

    Regards

    Jyotsna Oberai 

    Kindly verify my answer if it helped you in any way. 

  • RE: Create webservice in NAV2018 to use in external app, return JSON with item information

    Well, I actually have three levels.... creating three webservices doesn't feel like the right solution.

    Thanks for you help, I will try to find another solution!

  • Suggested answer
    Jyotsna NAV Profile Picture
    Jyotsna NAV 585 on at
    RE: Create webservice in NAV2018 to use in external app, return JSON with item information

    You can have an odata too for your CRUD operations.

    This two level is not quite feasible and complicated something called as deep insert. For a data like this,what I can also recommend is to create two web services one for Item and another for Item variant and use it's odata as pages. (For passing data from nav to external application)

    The external application can use these 2 services in their JavaScript and accept it that way.

    Thank you.

    Regards

    Jyotsna Oberai

    Please mark my answer as verified if it helped you in any way.

  • RE: Create webservice in NAV2018 to use in external app, return JSON with item information

    Thanks Jyoysna,

    Couple of questions....

    I can only use this as a SOAP?

    I don't understand how to expose the JSON build in the function GetItem?

    How can I build a JSON with multiple levels (item -> item variant)?

    I would like to do a webservice call like this.... webservice url/getitemnumber('1000')

    and return a JSON like this....

    {

     "name": "Item description",

    "itemnumber": "1000"

     },

     "variants": [

       {

         "name": "White",

         "inventory": 11

       },

       {

         "name": "Red",

         "inventory": 13

       }

     ]

    }

  • Suggested answer
    Jyotsna NAV Profile Picture
    Jyotsna NAV 585 on at
    RE: Create webservice in NAV2018 to use in external app, return JSON with item information

    Check these two Integration blogs: 

    jyotsnanav.blogspot.com/.../integrating-dynamics-365-field-service.html

    https://jyotsnanav.blogspot.com/2020/04/integrating-dynamics-365-field-service_19.html?m=1

    Thank you. 

    Regards

    Jyotsna Oberai 

    Please mark my answer as verified if it helped you in any way. 

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans