5

I built an interactive report based on View That Contains the master & details data, and I used Column Break To let the Report makes sense, and I used The master ID as a link to report that I built using FO Designer, so I used a hidden Item to set the ID value in it, and to print the report based on this value.

So I used a dynamic action to set the value from the record (using $s('P50_NEW',this.triggeringElement.id)). but the value didn't stored in the Item (The Session State), and I stuck here.

Please Can anyone help me how to do it please, and how to make apex to set the session state at first then print the report.

Thanks.

2 Answers 2

9

As per the API Reference, the $s('P50_NEW',this,triggeringElementId) doesn't set the value in session state. The scope of $s(...) setting is for the current page, not for the session.

In order to set the value in session, you can invoke apex.server.process API to set the value in session.

So, the updated Javascript for Dynamic Execution will be like the following:

$s('P50_NEW',this.triggeringElement.id);
apex.server.process ( "SAVE_HIDDEN_VALUE_IN_SESSION_STATE", {
  x01: "set_session_state",
  pageItems: "#P50_NEW"
  }, {dataType: 'text'} );
0
1

If you would need to set session state to use the value in a report SQL source, the simplest solution would be to specify the item name in the report Page Items to Submit attribute and refresh the report:

apex.item( "P50_NEW" ).setValue (this.triggeringElement.id);
apex.jQuery('#Report').trigger('apexrefresh');

(assuming that the report Static ID is Report)

Not the answer you're looking for? Browse other questions tagged or ask your own question.