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
indyindy 

Reference Static Resource from an OnClick Java Script List Button

Hi,

How to reference static resource in  list button.

i.e My js file in Static Resource contains: (Static Resource is saved as 'LiquidatedAccounts')
<script>
{!REQUIRESCRIPT('/soap/ajax/25.0/connection.js')}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}


function liquidatedAccount()
{
var acc=true;
return acc;
}

</script>


In my list buttton(Execute Java script behaviour) , I am calling the liquidatedAccount() method in the following way and getting an error message says 'liquidatedAccount' is not recognized, Please suggest.

{!REQUIRESCRIPT('/soap/ajax/25.0/connection.js')}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}
{!REQUIRESCRIPT("/resource/1392210043000/LiquidatedAccounts")}

var test1 = liquidatedAccount();
alert(test1);



Thanks,
Indy
indyindy
Ankit, Thanks for your reply. But when try to save the below code as you suggested I am getting the below error message 'Field $Resource.LiquidatedAccounts does not exist. Check spelling.' {!REQUIRESCRIPT('/soap/ajax/25.0/connection.js')} {!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")} {!REQUIRESCRIPT("/resource/1392210043000/LiquidatedAccounts")} Thanks, Indy