function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Philip ZimmermanPhilip Zimmerman 

Converting JS window.open to Lightning for Report Parameters

I'm trying to replicate a custom button I had that would launch a report and immediately bring up the dialogue box to save the report.

I used this code to make that happen:
window.open('/00O63000000HEhL?pv0={!Batch__c.Id}&export=1')

I have read all of the documentation and am trying to get the following to work:
{!URLFOR( $Action.Report.ReportExportAction , "00O63000000HEhL", [ fv0=Batch__c.Id ])}

Anybody know what I am doing wrong here?  It will launch the report but will not apply my parameters and will not export it.


 
Diksha Goel 6Diksha Goel 6

Hey Philip,

Refer this,
https://salesforce.stackexchange.com/questions/128597/how-to-open-in-lightning-experience-a-custom-visualforce-page-that-requires-para
https://developer.salesforce.com/forums/?id=906F0000000BWr4IAG

Hope this helps you.

Diksha Goel

Sukanya BanekarSukanya Banekar
Hi,
You should give the org instance url in window.open
window.open('org instance url/00O63000000HEhL?pv0={!Batch__c.Id}&export=1')
Let me know if this works

Thanks,
Sukanya Banekar
Pramodh KumarPramodh Kumar
@Philip Zimmerman

Js buttons wont work in lightning environment. For your requirement you have to create the New Button/Link as URL type.

First pieces you need domain    "yourinstance.lightning.force.com/one/one.app#"
second you need 18 digit report Id for exporting the report. If you wont include the 18 digit report id then you wont get the export option.


Example here is the url for the report including the filters

yourinstance.lightning.force.com/one/one.app#/sobject/18DigitreportId/view?a:t=&fv0={!Batch__c.Id}&export=1

Thanks
pRAMODH.