How To get Sales Order with webservice without a Key

Hi. I am new to microsoft Nav and i am finding it difficult to make a webservice call to find a sales header without using the key.

My codeunit looks like this

GetSalesorder(SalesHeader : Record “Sales Header”;Ref : Text) KeyIs : Text

SalesHeader.INIT;

SalesHeader.“No.” := Ref;

IF SalesHeader.Get THEN

keyIs := SalesHeader.“No.”

ELSE

KeyIs := ‘Nothing Found’;

I am trying to return the Key or OrderNo which is No. but i know i cannot get the key from the record as the error keeps coming up saying undefined variable key. That aside

How can i call my web service so that i can find an order based on any field. My webservice is SOAP not odata. Any help will be great. as i have been on this for two days now.

So also i noticed that if i define a function without a record and expose it as a webservice it crashes my webservice and if the Record is also not defined as a parameter and as the first parameter it also crashes the service. Pls i need serious help in knowing how to retrieve a web-service without The Key but with my own field like external_document_ref.

hi

to get records by field values use function read multiple with field filters.

follow https://msdn.microsoft.com/en-us/library/ff477110(v=nav.70).aspx

is your question answered? if yes, please verify. thx.