2

I have a vf page on that page i have a custom setting record page link that is working fine in salesforce classic but not in lightning..in Lightning i got this url when i tried that find with setup then this encoded url i got...

https://myinstancename/one/one.app?source=aloha#/setup/page?nodeId=CustomSettings&address=/setup/ui/viewCustomSettingsData.apexp?appLayout=setup%26setupid%3DCustomSettings%26sfdcIFrameHost%3Dweb%26isdtp%3Dp1%26sfdcIFrameOrigin%3Dhttps%253A%252F%252Fmyinstancename%26tour%3D%26id%3Da0558000005rNUQ

i tried to decode it but after applayout i am not able to decode that..and this url is hardcoded..how i create this url in vf page for lightning..please help me.

  • Can you Add your custom setting URL which you are referring in VF page? there are several way to navigate in lightning. – Sagar Thoriya Nov 10 '17 at 9:01
  • in vf page <a href="{!'/one/one.app?#/sObject/'+ record.Id + '/view'}" target="_blank"> i don't know how i create this(url that i post in question) in vf page – sonam Nov 10 '17 at 9:04
  • why are you using one/one.app for navigation in classic – Manjot Singh Nov 10 '17 at 9:05
  • Which URL you are using for classic? can i see the URL for classic ? – Sagar Thoriya Nov 10 '17 at 9:05
  • @ManjotSingh no that is i using for lightning. – sonam Nov 10 '17 at 9:07
3

To navigate in lightning experience using URL you can use below syntax,

/one/one.app#/alohaRedirect/recordId 

OR

/one/one.app#/alohaRedirect/Vfpage 

OR ( For custom Setting record detail page)

/one/one.app#/setup/page?nodeId=CustomSettings&address=/{!customSettingRecordId}
  • this is not working..in fact with this my page also not stopping it is getting redirecting again and again – sonam Nov 10 '17 at 9:39
  • is there any solution @sagar – sonam Nov 10 '17 at 10:07
  • @sonam I have updated the answer with possible solution. It's working for me. – Sagar Thoriya Nov 10 '17 at 11:22
  • this is redirecting in custom setting but not on record..i am getting error page not found. i am using like this :- <a href="{!'/one/one.app#/setup/page?nodeId=CustomSettings&address={!recordid}'}" target="_blank"> – sonam Nov 10 '17 at 11:29
  • Your syntax is wrong, Try Like this -> <a href="/one/one.app#/setup/page?nodeId=CustomSettings&addr‌​ess=/{!recordid}" target="_blank"> – Sagar Thoriya Nov 10 '17 at 11:32
0

You can use

<script> 
function redirectTo(url){
            if(typeof sforce !='undefined' && sforce.one) {
                    sforce.one.navigateToURL('/one/one.app#/setup/page?nodeId=CustomSettings&address=/'+url);
                }
                else {
                    window.location.href = '/'+url;
                }
        }    
</script> 

<a href="#" onclick="redirectTo({recored.id})">

Above will work in both lightning and classic.

  • this is also not working....actually i am trying to access the custom setting of type list in lightning. – sonam Nov 10 '17 at 11:05
  • @sonam I had made changes now above will work – Manjot Singh Nov 10 '17 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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