How to Publish Tables (50000) series as Web Service

ChessExpert
Member Posts: 103
Hello there Experts.
I have a custom table e.g.
Table ID # = 50000
Name = District
that I would like to add to "Web Services" (Form#810).
Problem: The problem is, when I open the "Lookup" for "Object ID", my custom table is not showing on the list.
Can you please advise on what to do for me to expose those custom tables.
Once again, thank you experts.
I have a custom table e.g.
Table ID # = 50000
Name = District
that I would like to add to "Web Services" (Form#810).
Problem: The problem is, when I open the "Lookup" for "Object ID", my custom table is not showing on the list.
Can you please advise on what to do for me to expose those custom tables.
Once again, thank you experts.
0
Answers
-
Hi ChessExpert,
You cannot expose tables directly as a web service. You can only expose Codeunits and Pages.
The answer is to create a page in the 50000 range using the Table as its source.
You can then expose the page as a web service which will give you access to insert, read, delete or update the table.
Regards,
Scarecrow0 -
Hello there, thank you for your reply.0
-
I am able to get this working.
Note: ThatI have to refresh my web reference from time to time and also restart the "NAV Business Web Service".
Thanks.0 -
Hi ChessMaster,
The error you are seeing indicates that you need to flush the object cache. I see this in the RTC also if you make changes to tables and don't restart the services.
I would suggest restarting both the web service and service tier services and try again.
The code snippet you supplied looks right.
I whipped up a test Page of type "Card" and built a quick Vb console app which works fine with a custom page in the 50000 range.Module Module1 Sub Main() Dim ws As New WebRef1.Test_Service ws.UseDefaultCredentials = True ws.Url = "http://localhost:7047/DynamicsNav/WS/GreatFoods/Page/Test" Dim flt(0) As WebRef1.Test_Filter Dim objRet(5) As WebRef1.Test objRet = ws.ReadMultiple(flt, "", 6) Dim i As Integer For i = 0 To 5 Console.WriteLine("Category Number: " + objRet(i).Category) Next System.Threading.Thread.Sleep(2000) End Sub End Module
Regards,
Scarecrow0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions