Display Method

Hi is it possible to return multiple line using display method?

This is my code:

display str TaxAmountNum()


str taxamountnum;


while select * from taxtrans where taxtrans.Voucher == ledgerjournaltrans.Voucher && ledgerjournaltrans.TaxGroup != “”


taxamountnum = taxtrans.AccountNum;

// info("tax amount: " + taxamountnum);


return taxamountnum;


i use this method in a string control in a report and it returns the last data only. how can i get the other data using this type of method or is there other way to pass all data in string control.


It’s not about display methods at all - try to run the code in job or so…

The code “taxamountnum = taxtrans.AccountNum;” overwrites the existing value every time, you have to add the value.

Thanks Martin! can you suggest any work around so that all the data that I want to capture will be shown in the report that I’m doing.


The implementation depends on what exactly you need and I would expect every developer to be able to do that…

One option is this:

str nums;
if (ledgerJournalTrans.TaxGroup == '')
    return '';
while select AccountNum from taxTrans
    where taxTrans.Voucher == ledgerJournalTrans.Voucher
    if (nums)
        nums += '\n';
    nums += taxTrans.AccountNum;
return nums;

Thanks for that Martin