You need to sign in to do that
Don't have an account?
Smita Hodiggeri
How to display a list of records to to print using aura component -- How to construct the URL to fetch all the records to print
Hi Community,
I have inherited an aura component that basically prints a list of records dispalyed right down below for the community users to print.
This was written back in 2017 and no body has seen it working.
I played around a bit and observed that The URL for salesforce community being used under Lightning experience Transition Assistant--> Feature Settings--> All Sites is changed to following
New URL
https://community.ausure.com.au
The URL being used in Controller.Js is
"url": "http://ausureib.force.com/AusureCommunity/MyCPDPointsRegister?recordId="+recordId
I am not sure how to construct a correct URL so that it prints all the records of CPD Register Points for a community user properly on clicking the button.
My Controller Code.
({
openCPDPointsList : function(component, event) {
var urlEvent = $A.get("e.force:navigateToURL");
var recordId = component.get("v.recordId");
urlEvent.setParams({
url:"http://ausureib.force.com/AusureCommunity/MyCPDPointsRegister?recordId="+recordId
});
urlEvent.fire();
},
})
Tried constructing URL Like
url": "https://community.ausure.com.au/s/my-cpd-register?recordId="+recordId
But this brings me back to the same page instead of taking me to printable view.
I have inherited an aura component that basically prints a list of records dispalyed right down below for the community users to print.
This was written back in 2017 and no body has seen it working.
I played around a bit and observed that The URL for salesforce community being used under Lightning experience Transition Assistant--> Feature Settings--> All Sites is changed to following
New URL
https://community.ausure.com.au
The URL being used in Controller.Js is
"url": "http://ausureib.force.com/AusureCommunity/MyCPDPointsRegister?recordId="+recordId
I am not sure how to construct a correct URL so that it prints all the records of CPD Register Points for a community user properly on clicking the button.
My Controller Code.
({
openCPDPointsList : function(component, event) {
var urlEvent = $A.get("e.force:navigateToURL");
var recordId = component.get("v.recordId");
urlEvent.setParams({
url:"http://ausureib.force.com/AusureCommunity/MyCPDPointsRegister?recordId="+recordId
});
urlEvent.fire();
},
})
Tried constructing URL Like
url": "https://community.ausure.com.au/s/my-cpd-register?recordId="+recordId
But this brings me back to the same page instead of taking me to printable view.
Go to the detail page of the record you want to print.
Right-click anywhere on the page and select "View page source".
Search for the URL of the page that displays the records. It should be something like https://<yourSalesforceInstance>.lightning.force.com/<recordId>.
Replace the <recordId> with {!recordId}, where recordId is a merge field that will be replaced by the actual record Id when the URL is called.
Save this URL in your component's JavaScript code as the URL for the navigation event.
Thank you for taking time to analyse the problem and providing a resolution.
This aura component button is on community.
When I click on the button CPD Points LIst to Print it should print the records displayed right down below the button which can be seen in the screenshot.
In order to obtain the recordid to construct the URL I right clicked on the bottom yellow highligted section of list view and I was lost!
Does it sound like I am still on the right path.
Much appreciate your help!
Thanks,
Smita