NAV Web Service - ReadMultiple with additional Parameters
timh
Member Posts: 3
Is there any way to pass additional parameters to a ReadMultiple function on a Page type NAV Web Service. I need the parameters in NAV to apply filtering on a related table to the one I am returning as part of the Page. I cannot do this through FlowFields or FlowFilters.
I am not opposed to using an extension codeunit, but I need to call it before the ReadMultiple and therefore I don't have a record instance to pass the Key for and it doesn't like null keys.
I know I could do it with a codeunit function that returns XML, but I would really like for this to return data from a Page Type web service in a single call if possible.
Thanks
tim
I am not opposed to using an extension codeunit, but I need to call it before the ReadMultiple and therefore I don't have a record instance to pass the Key for and it doesn't like null keys.
I know I could do it with a codeunit function that returns XML, but I would really like for this to return data from a Page Type web service in a single call if possible.
Thanks
tim
0
Comments
-
something like this?
Dim retval As New List(Of hybridObjects.customerConfirmation)
Dim lstOrders() As SalesHeaderCard
Dim filters As List(Of SalesHeaderCard_Filter) = New List(Of SalesHeaderCard_Filter)
Dim filter As SalesHeaderCard_Filter
'sales header service pointer
Dim SalesHeaderService As SalesHeaderCard_Service = New SalesHeaderCard_Service
With SalesHeaderService
.Url = System.Web.HttpUtility.HtmlEncode(_wsURL & "Page/SalesHeaderCard")
.UseDefaultCredentials = False
.Credentials = _creds
End With
'set filter values
filter = New SalesHeaderCard_Filter
filter.Field = SalesHeaderCard_Fields.Document_Type
filter.Criteria = paenav.SalesHeaderCard.Document_Type.Order
'filter.Criteria = Document_Type.Return_Order 'just change to this doc type for ra's
filters.Add(filter)
filter = New SalesHeaderCard_Filter
filter.Field = SalesHeaderCard_Fields.Order_Date
filter.Criteria = ">=" & orderDate
filters.Add(filter)
'try filtering by originatorUserID
filter = New SalesHeaderCard_Filter
filter.Field = SalesHeaderCard_Fields.Location_Code
filter.Criteria = locationCode
filters.Add(filter)
lstOrders = SalesHeaderService.ReadMultiple(filters.ToArray(), "", 0)
If ((lstOrders IsNot Nothing) And (lstOrders.Length > 0)) Then
For Each shc As SalesHeaderCard In lstOrders
Dim custConfirmation As New hybridObjects.customerConfirmation
With custConfirmation
.po = shc.Your_Reference
.orderNumber = shc.No
.orderDate = shc.Order_Date
.orderStatus = shc.Status.ToString
.requestedDeliveryDate = shc.Requested_Delivery_Date
.sellToCust = shc.Sell_to_Customer_Name
.billToCust = shc.Bill_to_Name
.orderAmt = shc.Amount
.blocked = shc.Blocked.ToString
End With
retval.Add(custConfirmation)
Next
'retval = lstOrders
End If
Return retval.ToArray
Catch ex As Exception
Return Nothing
End Try
End Function0 -
Thanks for the reply.
However, I don't think this helps with my situation.
What I really need is to return an Item List with Prices based on a Customer No., Customer Price Group and Customer Discount Group.
What I can't figure out is how to feed the Item Card web service the parameters Customer No., Customer Price Group and Customer Discount Group so that it can use them to calculate the proper Price to include in the returned list of items on a ReadMultiple call.
Thanks,
timh0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions