I couldn't find any examples that loops through a document service.. i found this example for ax 2009 but got a massive headache after going through it(not sure if it's applicable to ax 2012): https://msdn.microsoft.com/en-us/library/cc652581%28v=ax.50%29.aspx (opens new window)
Here's what I have so far:
// Create the service client proxy
SalesOrderService.SalesOrderServiceClient c1 = new SalesOrderService.SalesOrderServiceClient();
// Create the Call Context
SalesOrderService.CallContext cc = new SalesOrderService.CallContext();
// Set the partition to "MyPartition"
cc.PartitionKey = ConfigurationManager.AppSettings["Partition"];
// Set the company to "MyCompany"
cc.Company = ConfigurationManager.AppSettings["Company"];
SalesOrderService.AxdSalesOrder salesResp;
SalesOrderService.EntityKey[] readSalesKeys = new SalesOrderService.EntityKey[1];
readSalesKeys[0] = new SalesOrderService.EntityKey();
readSalesKeys[0].KeyData = new SalesOrderService.KeyField[1];
readSalesKeys[0].KeyData[0] = new SalesOrderService.KeyField();
readSalesKeys[0].KeyData[0].Field = "SALESID";
readSalesKeys[0].KeyData[0].Value = "000733";
How would I loop through salesResp.SalesTable[0].SalesLine[i] to get all the salesline records for this order?

Code examples would be much appreciated!
*This post is locked for comments
I have the same question (0)