• DTAPADMIN
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 14
    Replies
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   ' ' .
My code seem to execute and the success message is displayed on the screen but the task is not being created.  Please look at the code below and give any input as to why this might not create the new task.

Code:
var queryResult = sforce.connection.query("Select CreatedDate, Project_Manger__c, Name, Implementation_Rep__r.Name, Implementation_Rep__c, Id, Go_Live_Planned_Date__c, Technology_Rep__r.Name, Technology_Rep__c From SFDC_Projects__c WHERE Name = '{!SFDC_Projects__c.Name}'");

var records = queryResult.getArray('records');

var myTask1 = new sforce.SObject("Task");
myTask1.WhatId = records[0].Id;
myTask1.OwnerId = records[0].Technology_Rep__r.Name;
myTask1.Status = 'Not Started';
myTask1.Priority = 'Normal';
myTask1.Subject = 'Create Customer DB from Base';
myTask1.IsReminderSet = true;
sforce.connection.create([myTask1], callback);
}

 

When creating a workflow task is there any way to assign the task to the value of a field?  For example on our projects we have an implementation rep field that is filled in with the training for that project.  Is there a way to have the workflow task assigned to that person without knowing who that is ahead of time?
Our developers use an opensource source-code control system called Subversion.  In this system when they make changes to code they can refrence a link that would take them in the issue in our old Sharepoint based Helpdesk system.  Now our Dev Manager wants to be able to put a link in Subversion with the Bug number and have it take the developer to that bug in Salesforce. 
 
How can I accomplish this?
 
Any suggestions would be greatly appreciated.
I am trying to create a button on the Case the appears as a List button on the Custom Object "Bugs" related list to update the status of the Case.  I have code that will updated the status when in the bug but this would update the status from the related list while looking at the Case.  My query works but I am not able to assign the status value of the Bug to the variable because it is a nested select statement. Here is my code below, if anyone can tell me how to assign the value returned from the child object in the query to my myObj.Status variable I would appreciate it.
 
Code:
<html> 
<head> 
<script src="/soap/ajax/9.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 
}; 

//This comment is to make sure the code is right 

var queryResult = sforce.connection.query("SELECT Id, (SELECT Status__c FROM R00N50000001Qr9OEAS) FROM Case WHERE CaseNumber = '{!Case.CaseNumber}'"); 

var records = queryResult.getArray('records'); 

if( /Closed/.test ( records[0].Status__c)) { 
alert("Please close the Case associated with this Bug!"); 
window.close(); 
} 
else { 
var myObj = new sforce.SObject("Case"); 
myObj.Id = records[0].Id; 
myObj.Status = records[0].Status__c; 
sforce.connection.update([myObj], callback); 
} 
} 

function displayResult(result) { 
document.getElementById("output-div").innerHTML = "Case successfully updated!"; 

} 

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

</head> 
<body> 
<div id="output-div"></div> 
</body> 
</html>

 
I have an S-control that updates the status of a case based on the status of a custom Bug object.  What I want to do now is check to see if the status of the Bug that is returned contains the word "Closed" if it does I want to send a message asking the user to Close the associated Case.  Here is my current code:
 
Code:
<html> 
<head> 
<script src="/soap/ajax/9.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 
}; 

var queryResult = sforce.connection.query("SELECT Case__r.Id, Status__c FROM SFDC_Bug__c WHERE Name = '{!SFDC_Bug__c.Name}'"); 

var records = queryResult.getArray('records'); 

var myObj = new sforce.SObject("Case"); 
myObj.Id = records[0].Case__r.Id; 
myObj.Status = records[0].Status__c; 
sforce.connection.update([myObj], callback); 
} 

function displayResult(result) { 
document.getElementById("output-div").innerHTML = "Case successfully updated!"; 

} 

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

</head> 
<body> 
<div id="output-div"></div> 
</body> 
</html>

 
Any help or suggestions would be greatly appreciated.
 
Thanks
I am trying to create an S-Control that updates the status of a Case to the value of the status of a bug which is a child custom object.  I get the error: Unexpected element {urn:partner.soap.sforce.com}done during simple type deserialization' when I click on the link to execute the S-Control. 
 
Here is my code:
 

Code:

<html>
<head>
<script src="/soap/ajax/9.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 
 };  
 var cnum = sforce.connection.query("SELECT Case__r.Id FROM SFDC_Bug__c WHERE Name = '{!SFDC_Bug__c.Name}'");    
 var bstatus = sforce.connection.query("SELECT Status__c FROM SFDC_Bug__c WHERE Name = '{!SFDC_Bug__c.Name}'");    
 var myObj = new sforce.SObject("Case");   
 myObj.Id = cnum;  
 myObj.Status = bstatus;   
 sforce.connection.update([myObj], callback);
} 

function displayResult(result) { 
 var it = new sforce.QueryResultIterator(result); 
 var html = []; 
 while(it.hasNext()) { 
 var record = it.next(); 
 if (record.Case__r) { 
 html.push("Case__r.Id = " + record.Case__r.Id + "Has Been Updated!" + "<br>"); 
 } 
 html.push("<hr>"); 
 html.push("<br>"); 
 } 
 document.getElementById("output-div").innerHTML = html.join("");
}
function displayError(error) { 
 document.getElementById("output-div").innerHTML = 
 "oops something went wrong ... " + error;
}

</script> 

</head>
<body> 
<div id="output-div"></div>
</body>
</html>


 
Any help would be greatly appreciated.

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   ' ' .
My code seem to execute and the success message is displayed on the screen but the task is not being created.  Please look at the code below and give any input as to why this might not create the new task.

Code:
var queryResult = sforce.connection.query("Select CreatedDate, Project_Manger__c, Name, Implementation_Rep__r.Name, Implementation_Rep__c, Id, Go_Live_Planned_Date__c, Technology_Rep__r.Name, Technology_Rep__c From SFDC_Projects__c WHERE Name = '{!SFDC_Projects__c.Name}'");

var records = queryResult.getArray('records');

var myTask1 = new sforce.SObject("Task");
myTask1.WhatId = records[0].Id;
myTask1.OwnerId = records[0].Technology_Rep__r.Name;
myTask1.Status = 'Not Started';
myTask1.Priority = 'Normal';
myTask1.Subject = 'Create Customer DB from Base';
myTask1.IsReminderSet = true;
sforce.connection.create([myTask1], callback);
}

 

I have an S-control that updates the status of a case based on the status of a custom Bug object.  What I want to do now is check to see if the status of the Bug that is returned contains the word "Closed" if it does I want to send a message asking the user to Close the associated Case.  Here is my current code:
 
Code:
<html> 
<head> 
<script src="/soap/ajax/9.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 
}; 

var queryResult = sforce.connection.query("SELECT Case__r.Id, Status__c FROM SFDC_Bug__c WHERE Name = '{!SFDC_Bug__c.Name}'"); 

var records = queryResult.getArray('records'); 

var myObj = new sforce.SObject("Case"); 
myObj.Id = records[0].Case__r.Id; 
myObj.Status = records[0].Status__c; 
sforce.connection.update([myObj], callback); 
} 

function displayResult(result) { 
document.getElementById("output-div").innerHTML = "Case successfully updated!"; 

} 

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

</head> 
<body> 
<div id="output-div"></div> 
</body> 
</html>

 
Any help or suggestions would be greatly appreciated.
 
Thanks
I am trying to create an S-Control that updates the status of a Case to the value of the status of a bug which is a child custom object.  I get the error: Unexpected element {urn:partner.soap.sforce.com}done during simple type deserialization' when I click on the link to execute the S-Control. 
 
Here is my code:
 

Code:

<html>
<head>
<script src="/soap/ajax/9.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 
 };  
 var cnum = sforce.connection.query("SELECT Case__r.Id FROM SFDC_Bug__c WHERE Name = '{!SFDC_Bug__c.Name}'");    
 var bstatus = sforce.connection.query("SELECT Status__c FROM SFDC_Bug__c WHERE Name = '{!SFDC_Bug__c.Name}'");    
 var myObj = new sforce.SObject("Case");   
 myObj.Id = cnum;  
 myObj.Status = bstatus;   
 sforce.connection.update([myObj], callback);
} 

function displayResult(result) { 
 var it = new sforce.QueryResultIterator(result); 
 var html = []; 
 while(it.hasNext()) { 
 var record = it.next(); 
 if (record.Case__r) { 
 html.push("Case__r.Id = " + record.Case__r.Id + "Has Been Updated!" + "<br>"); 
 } 
 html.push("<hr>"); 
 html.push("<br>"); 
 } 
 document.getElementById("output-div").innerHTML = html.join("");
}
function displayError(error) { 
 document.getElementById("output-div").innerHTML = 
 "oops something went wrong ... " + error;
}

</script> 

</head>
<body> 
<div id="output-div"></div>
</body>
</html>


 
Any help would be greatly appreciated.

I am looking for a way to do an automatic update on cases billing status picklist field when ever a user changes the a custom object pick list field.  Was wondering if anyone knows a work around on this?  I was told a custom  S control would prob do the trick.  HELP/?