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
bheemudu neelibheemudu neeli 

Salesforce javascript button not working properly

Hi All,
Salesforce javascript button not working properly, code is as follows, but in the below code line if('records.Origin'==='EF New Issues'){ is failing, Need a help to complet it.

................................
{!REQUIRESCRIPT("/soap/ajax/35.0/connection.js")}

var url = parent.location.href;
var records = {!GETRECORDIDS($ObjectType.Case)};
var updateRecords = [];
records.id = "{!Case.Id}";
records.Origin= "{!Case.Origin}";

if (records[0] == null) {
alert("Please select at least one record to Update.");
}

else{

if('records.Origin'==='EF New Issues'){
console.log(records);
window.location = 'apex/MassCaseStatus_change?id='+records.join(',');

}
else{
alert("Please select All records as origin is EF new Issues.");
}
}
.................................

Thank you,
Bheem
PriyaPriya (Salesforce Developers) 

Hi Bheemudu,

What error did you receive and can you please paste the enitre code?

regards,

Priya Ranjan