Dear experts,
I have a form that shows data of GeneralJournalEntry table data, and a button Print. When the button is clicked, the selected records's JournalNumber in grid will be sent to query LedgerTransPerJournal as range. I created a container that stores the selected records's journalNumber, when I set the container data as range in query, there are some '\' appear after each journalNumber. I don't how why it happened, the method i used is con2str().
This is my code of Print button:
void clicked() { GeneralJournalEntry locGeneralJournalEntry; Query q; QueryRun qrun; container conJournalNum; locGeneralJournalEntry = GeneralJournalEntry_ds.getFirst(true); q = new Query(queryStr(LedgerTransPerJournal)); q.dataSourceTable(tableNum(GeneralJournalEntry)).clearRanges(); if (!locGeneralJournalEntry) { warning('Voucher lines must be selected'); return; } else { while (locGeneralJournalEntry) { //info(strFmt('%1', locGeneralJournalEntry.SubledgerVoucher )); //q.dataSourceTable(tableNum(GeneralJournalEntry)).addRange(fieldnum(GeneralJournalEntry, JournalNumber)).value(SysQuery::value(locGeneralJournalEntry.JournalNumber)); conJournalNum += [queryValue(locGeneralJournalEntry.JournalNumber)]; locGeneralJournalEntry = GeneralJournalEntry_ds.getNext(); } q.dataSourceTable(tableNum(GeneralJournalEntry)).addRange(fieldnum(GeneralJournalEntry, JournalNumber)).value(SysQuery::value(con2Str(conJournalNum))); qrun = new QueryRun(q); qrun.prompt(); } }
This is the screen of QueryForm:
*This post is locked for comments