Consuming a Web Service using Extension Codeunits

Hi,

I need to do something like an expose of Page Item List using a flowfilter for the “Location Filter”.

I have created a codeunit for that and I have configure correctly this codeunit in Web Service Table.

My function has 2 parameters, rec_Item and Location_Filter and line “rec_Item.SETFILTER(“Location Filter”, Location_Filter);”

My question is how can I call readmultiple and apply this filters to get inventory flowfield for my specific location filter?

If location filter can be the same for all items in my opinion could be a good solution creating an XMLport with a GetParameter function in order to receive the filter string.

I already have created a xmlport for this, and it works fine, but it’s really not possible to do this (apply flowfilters) with the extended web servisse?

Adding a flowfilter to a page exposed as a webservice causes an error and, as far as I know, there are no KB released by Microsoft to fix it…

Yes, but with a codeunit we can solve that limitation, and it works when you have a specific record and passes it at the first parameter of the codeunit function exposed as as extention of the web service. My problem is that i don’t want to call this funtions for all the records returned when I call the readmultiple, I want to call it once, and then call the readmultiple, but it doesn’t work. The functions needs always the record key as the first parameter.

An alternative is first call a single read and then call the function with the record key and then call the readmutiple.

Another alternative is call the readmultiple and then for each record call the function with each record key.

But none of this alternatives are correct, and aren’t eficient. I think I just need to call the function once, at the begining, and then call the readmultiple. It should respect the filter that I has nade at the begining, when I call the function to set the flowfilter.