Rating:
4
Joined: Feb 26, 2015
Company: Uguz Limited sirketi
Hi,
I want to ask a question.
I have one document. Entering into business records. I want a list of all entries in this document. I can only see the last record. What am I doing wrong?
Code
Function TestTest(Request)
Response = New HTTPServiceResponse(200);
Result = "";
Query = New Query;
Query.Text =
"SELECT
| UguzIsTakip.Date AS Date,
| UguzIsTakip.CariHesap.Kompleİsmi AS CariHesapKompleİsmi,
| UguzIsTakip.GorusmeTipi.Description,
| UguzIsTakip.GorusmeNedeni.Description,
| UguzIsTakip.GorusmeDurumu.Description,
| UguzIsTakip.GorusmeDetayi,
| UguzIsTakip.GorusmeSonucu
|FROM
| Document.UguzIsTakip AS UguzIsTakip
|
|ORDER BY
| Date,
| CariHesapKompleİsmi";
QueryResult = Query.Execute();
SelectionDetailRecords = QueryResult.Select();
JSONWriter = New JSONWriter;
JSONWriterSettings = New JSONWriterSettings(, Chars.Tab);
JSONWriter.SetString(JSONWriterSettings);
yapi = New Structure;
While SelectionDetailRecords.Next() Do
yapi.Insert("Tarih",SelectionDetailRecords[0]);
yapi.Insert("Unvan",SelectionDetailRecords[1]);
yapi.Insert("GorusmeTipi",SelectionDetailRecords[2]);
yapi.Insert("GorusmeNedeni",SelectionDetailRecords[3]);
yapi.Insert("GorusmeDurumu",SelectionDetailRecords[4]);
yapi.Insert("GorusmeDetayi",SelectionDetailRecords[5]);
yapi.Insert("GorusmeSonucu",SelectionDetailRecords[6]);
EndDo;
WriteJSON(JSONWriter, yapi);
Result = JSONWriter.Close();
Response = New HTTPServiceResponse(?(True, 200, 404));
Response.SetBodyFromString(Result, TextEncoding.System);
Return Response;
EndFunction