I think there is one confusing part:
At first it's written:
Added "keyname=ActCodeForSale"
---------
Then later in the example you use "sortfield":
http://localhost:5557/api/1/INVc?sortfield=ActCodeForSale&&fields=Code,Name
Should we use "keyname" or "sortfield"