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
enossirenossir 

JS list button thats a URL to a custom URL.

window.open('/{!$Setup.SVC_Reporting_Ids__c.InterfaceReportId__c}?pv0={!Account.Id}');

Theres the button, now i'm trying to find the simplest way to get this to work in lightning, because theres 50 or so buttons like this, that i'll have to manually convert..(because the configurator doesn't want to do it).

This button is on a related list.

I can't for the life of me figure out the syntax to get it to work as a custom URL button. I'm thinking of just making a VF page to run a <script></script>. 

Would either of these be possible or am i stuck using lightning components....
Santosh Reddy MaddhuriSantosh Reddy Maddhuri
Hi enossir,

Create a visualforce page and include the above link.Assuming there is only line of above code here is the sample.
 
<apex:page standardController="<objectName>" lightningStylesheets="true" docType="html-5.0" >


      <apex:includeScript value="/soap/ajax/43.0/connection.js"/>
      <apex:includeScript value="/soap/ajax/43.0/apex.js"/>
     
    <script type="text/javascript">
        sforce.connection.sessionId = '{!$Api.Session_ID}';
    </script>
    
     <script type = "text/javascript">
         
        window.onload = Mainfunct;

       function Mainfunct() {

                  string URL = "{!$Setup.SVC_Reporting_Ids__c.InterfaceReportId__c}"+'?pv0='+"{!Account.Id}";

                     if (sforce.one != undefined) {
                            // Lightning
                            sforce.one.navigateToSObject(URL);
                      } else {
                            // Classic
                             window.parent.location = '/' + URL;
                      }  

        }

      </script>     

</apex:page>


Call this page in the related list button.This should do the trick.

Hope this helps!


Regards,

Santosh.