Sales Order Searching in AX

Is there a built in method in AX that allows searching of sales orders which I can use via the AX Business Connector? I’ve searched msdn but I’m unable to find anything, I’m pretty new to all of this!

My understanding is that I would return and iterate through a query run object listing all of the sales orders based on a parameter (I assume this would be the sales id?)

If not I assume I would have to create my own method to handle this functionality in x++?

Any help would be appreciated.

Update

I’ve tried the following but “record.found” is always equal to false, even though I do have a SalesTable with a SalesId of S215415:

AxaptaRecord table = (AxaptaRecord)ax.CreateAxaptaRecord("SalesTable");

AxaptaRecord record = (AxaptaRecord)table.Call("find", "S215415");

while (record.Found)
{
     // do stuff
}

After debugging, I see that “table.Found” is equal to false too!