Generating, Attaching and Viewing reports with 1 click without needlessly regenerating

Continuing the discussion from Accessing PDF created by reporting framework:

@jeremy.keller is there a way to save a report to a record, and view it in a single action? If I understand correctly,

  • Queue Report action is the one that must be used to attach a report to a record.
  • To view and generate a report, you can create an app link to a report application with target type of Container, but you can’t save the generated report to a record.
  • To view a previously created report, you can create an app link to a report application with target type of Container and pass it a record and it will show you the attachment.

But I’m not sure how to bring these together to. Via a single action, I want this to happen so the user doesn’t have to think about it:

IF NOT previously generated
THEN generate, attach and view report
ELSE view previously generated and previously attached report

Can anyone think of a way to do this?

I can think of 2 potential solutions:

  1. Utilize the inline attachment viewer - this would potentially work if the report can be attached to the record the user is viewing
  2. There is a way to attach a report to a record outside of the queue report action - there just needs to be a few fields set in the report params, like which record to attach to and what to name the attachment. This has been used previously in Nextworld built solutions.

These 5 fields will need to be on the Report Version app/table and likely data mapped when the report version app is called to make this work:

ReportAttachmentTable
ReportAttachmentRecordId
ReportAttachmentName
ReportDisplay
ReportAttachmentRegenerate