Hi everyone.
I'm pretty new to Uniface, so there's a good chance my question is basic, but I tried searching docs and Internet and didn't find the answer.
I also might mixed up correct terms between occurences, entities, etc.. sorry for that, I'll try to be understandable.
I've made a (web)service. In my component, I've painted needed entities et all.
For now, I've made several operations for retrieving datas from a web browser (using VueJS/Ajax). It works, cool.
I've worked mostly this way :
I use the GET parameters to filter the entity, I then loop all occurrencies
lineList = $newstruct
forentity "lf_lines"
line = $newstruct
line->$name = "%%no_order.lf_lines"
line->qty = "%%qty.lf_lines"
line->article = "%%artcode.lf_lines"
line->noline = "%%no_line.lf_lines"
lineList->*{-1} = line
endfor
And then convert my struct to json and send it back with $webinfo("OUTPUT")
For the operation I'm currently working on, I need to get all the field of the entity occurence. That means around 40 fields (for reasons...).
I know for sure I will only have one answer (or zero) because my GET parameters are the primary key.
Is there a way to avoid declare all the field one by one ? Something like converting my answer to JSON (or to struct then to JSON) ?
Thanks in advance for your answers, and don't hesitate to ask me if I'm not clear !
Regards,
JM






