You need to sign in to do that
Don't have an account?
reettik mitra
Site scripting in Salesforce
When running this code in developer console then I am getting the output that is the full page code but when I am using the apex code in Lightning Web Component then I a getting the exact value that I want. Note:- LexSessionController provides the session Id When using LWC.
The Output I am getting Using the Lightning Web Component.
The Output I am getting Using the Developer Console(Which is correct and required).
The Output I am getting Using the Lightning Web Component.
The Output I am getting Using the Developer Console(Which is correct and required).
String sfdcURL = URL.getSalesforceBaseUrl().toExternalForm(); String sessionId = LexSessionController.fetchUserSessionId(); String sessionIdTrim=sessionId.substring(0,15); sfdcURL=sfdcURL+'/setup/org/orgstorageusage.jspid=&setupid='+sessionIdTrim+'CompanyResourceDisk&retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DDataManagement'; String html = new PageReference(sfdcURL).getContent().toString();
I tried below instead inplace of LEXController you stated It appears to be an issue with the sfdcURL
Please consider correcting from
sfdcURL=sfdcURL+'/setup/org/orgstorageusage.jspid=&setupid='+sessionIdTrim+'CompanyResourceDisk&retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DDataManagement';
sfdcURL=sfdcURL+'/setup/org/orgstorageusage.jsp?id='+sessionIdTrim+'&setupid=CompanyResourceDisk&retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DDataManagement';
Despite making this correction, if it still doesn't work ,you might want to try https://www.sfdcpoint.com/salesforce/navigation-service-in-lwc/
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you