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
DTAPADMINDTAPADMIN 

Merge fields don't work in Firefox

For some reason when have the Firebug open in Firefox it appears that Firefox is not recongnizing any of the merge fields in my s-controls.  In IE the s-controls are running just fine and it populates by query with the name of the object just fine. 
 
Do you know of any reason this would happen or are there know issues with Firefox 2.0.0.14 and merge fields?
 
Below is a smaple of my s-control that doesn't work in Firefox.
 
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> 
<head> 
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/12.0/connection.js"></script>
<script src="/js/dojo/0.4.1/dojo.js"></script>
<script>
dojo.addOnLoad(init); 

function init() { 
var callback = { 
onSuccess : displayResult, 
onFailure : displayError 
}; 
sforce.connection.query("SELECT Id, (Select Passed_QA__c From Returns__r) FROM SFDC_Bug__c WHERE Name = '{!SFDC_Bug__c.Name}' ", callback); 

} 

function displayResult(result) { 
var it = new sforce.QueryResultIterator(result); 
while(it.hasNext()) { 
var record1 = it.next(); 
if (record1.Returns__r) { 
displayReturnsResult(new sforce.QueryResultIterator(record1.Returns__r), record1); 
} 

} 

} 
function displayReturnsResult(it, record1) { 
var qaReturn = 'true';
while(it.hasNext() && (qaReturn == 'true')) { 
var record2 = it.next(); 
var status = record2.Passed_QA__c;
if (status = 'true'){
 var qaReturn = 'true';}
else {
 var qaReturn = 'false';
 }

}
var myObj = new sforce.SObject("SFDC_Bug__c"); 
myObj.Returns_Passed_QA__c = qaReturn; 
myObj.Id = record1.Id; 
sforce.connection.update([myObj]); 

 
}

function displayError(error) { 
document.getElementById("output-div").innerHTML = 
"oops something went wrong ... " + error; 
} 


 
</script> 


</head> 
<body> 

<div id="output-div"></div> 

</body> 
</html>

 
Instead of the Bug Name in Firefox it is just   ' ' .
werewolfwerewolf
What's the context from which you're running this Scontrol?  If you're not running it inline on an SFDC_Bug__c page, or called directly from an SFDC_Bug__c page, then Salesforce will not have the context necessary to fill that merge field.
werewolfwerewolf
Also, query on SFDC_Bug__c.Id if you can, not Name, unless you have lots of SFDC_Bug__c with the same name and you want to get the dupes.  The Id query will probably be faster.
DTAPADMINDTAPADMIN
I am running it as an inline s-control.
CaptainObviousCaptainObvious
if (status == 'true'){
 
small syntax error, but it may be the fix :smileyvery-happy:
DTAPADMINDTAPADMIN
Yes that was an issue with the code.  I fixed that and Firefox still doesn't see the Merge field value.