I was curious if there is an easy way to grab the entire report of an object execution and store it in a variable,?
You should ask yourself whether VARAs are the right
place to store reports because they have some limitations. With
PREP_PROCESS_REPORT you have the possibility to read of any report that is in
the DB. You only need the RunID of the report that interests you. Store the
RunID in the VARA and get the report when you need it.
If you wona do that anyway, this is no valid script,
but I’m sure you get the idea:
:SET &HND# = PREP_PROCESS_REPORT():PROCESS &HND#: SET &REPORT_LINE# = GET_PROCESS_LINE(&HND#): SET &LINE_COUNT# = &LINE_COUNT# + 1: put_var VARA, &LINE_COUNT#, &ICTV_LINE#:ENDPROCESS
Thank you Guenter, if I am looking to pass all the lines of the report into a put_read_buffer variable, do you think it would be advantageous to set all the lines into an array?
thought you meant variable objects (VARA) and not script variables.
opinion script Variables are too limited to store reports. Strings have the
limit of 1024 characters. You also have to consider how to deal with the line
breaks. The hand over of such large data like whole reports is also not the
intention of put_read_buffer.
I do not recommend
writing the report in a VARA object. Although this would be possible.
read the report directly from the database wherever you need it by PREP_PROCESS_REPORT(<RunID
of the execution>). If you need to read the report in a child object you
can determine the RunID of its parent by GET_PARENT_NR. If you need the report
in any other object, I would store the RunID in an VARA and get it when needed.
That sounds like a good approach. For my personal use, I am being asked to pass the whole report into a Web Service object that creates an incident ticket in Service Now. To simplify, passing a variable into a field and that variable will populate the field with the entire report, and I am trying to figure out the best practice for doing so.
Retrieving data ...