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
rohit.mehtarohit.mehta 

SOAPAction HTTP header missing

I keep getting this error time and again when I do a query from a SControl
 
"SOAPAction HTTP header missing".
 
There is no pattern...sometimes it comes and the next time it works fine.
 
Any help is appreciated.
 
Thanks
Rohit
London BenLondon Ben

Hi Rohit,

I've NEVER seen this error - with a large number of scontrols deployed in a large number of sites etc.

So - I'm assuming that there is something unusual about this situation.
 
Perhaps you can provide a bit more detail about the situation that this is happening...
 
Any particular browser/version?  and perhaps an example of one of your scontrols where this is happening?
 
Ben
SunilSunil

Hi Rohit,

I have not seen this error before. Please put few lines of sample code to get better usderstanding about your problem.

Sunil

rohit.mehtarohit.mehta
Here is the code snippet - - The method setupPage is called onload and also on change of a combo box. BTW...I have never seen the method fail onload. - setupPage function queries the opportunity based on the user id and a date range. - On change of combo field - function handleCloseDateFilterChanged() is called. This function then calls the setupPage function. <script type="text/javascript" src="/static/102207/js/functions.js"></script> <script src="/dJS/en/1202941525000/library.js" type="text/javascript"></script> <script src="/soap/ajax/12.0/connection.js" type="text/javascript"></script> <script type="text/javascript"> function setupPage() { //reset everytime OppRecords = []; if (dayArray == null || dayArray.length == 0) { setDayArray(); } var soql = "Select o.Id, o.Renewal_Notice_Email__c, o.Probability, o.OwnerId, o.Owner.Name, o.Owner.Phone, o.Owner.Title, o.Name, o.LastActivityDate, o.CloseDate, o.Amount, o.Account.Name, o.AccountId From Opportunity o"; var soqlClause = " Where o.OwnerId = '{!$User.Id}'"; if (currentSource == DAYS_30) { soqlClause += " AND o.CloseDate = NEXT_N_DAYS:" + dayArray[DAYS_30]; } else if (currentSource == DAYS_60) { soqlClause += " AND o.CloseDate > NEXT_N_DAYS:" + dayArray[DAYS_30] + " AND o.CloseDate = NEXT_N_DAYS:" + dayArray[DAYS_60]; } else if (currentSource == DAYS_90) { soqlClause += " AND o.CloseDate > NEXT_N_DAYS:" + dayArray[DAYS_60] + " AND o.CloseDate = NEXT_N_DAYS:" + dayArray[DAYS_90]; } soql += soqlClause; var qr = sforce.connection.query(soql); if (qr && qr.size) { OppRecords = qr.getArray("records"); draw(); } else { alert("No results for the selected criteria"); } } function handleCloseDateFilterChanged(closeDateCombo) { var closeDateFilter = closeDateCombo[closeDateCombo.selectedIndex].value; var result = confirm("You will lose all your changes if any. Click Ok to continue or Cancel to stay"); if (! result) { closeDateCombo.selectedIndex = currentSource; return false; } currentSource = closeDateFilter; setTimeout('setupPage()', 100); } </script>
rohit.mehtarohit.mehta
The earlier code snippet was not clear. Repeating it here.
 
Code:
<script type="text/javascript" src="/static/102207/js/functions.js"></script>
<script  src="/dJS/en/1202941525000/library.js" type="text/javascript"></script>
<script src="/soap/ajax/12.0/connection.js" type="text/javascript"></script>
<script type="text/javascript">
var OppRecords;

var dayArray;
var DAYS_30 = 0;
var DAYS_60 = 1;
var DAYS_90 = 2;
var currentSource = DAYS_30;

function setupPage() {

 //reset everytime
 OppRecords = [];
 
 if (dayArray == null || dayArray.length == 0) {
  setDayArray();
 }
 

 var soql = "Select o.Id, o.Renewal_Notice_Email__c, o.Probability, o.OwnerId, o.Owner.Name, o.Owner.Phone, o.Owner.Title, o.Name, o.LastActivityDate, o.CloseDate, o.Amount, o.Account.Name, o.AccountId From Opportunity o";
 var soqlClause = " Where o.OwnerId = '{!$User.Id}'";
 if (currentSource == DAYS_30) {
  soqlClause += " AND o.CloseDate = NEXT_N_DAYS:" + dayArray[DAYS_30]; 
 } else if (currentSource == DAYS_60) {
  soqlClause += " AND o.CloseDate > NEXT_N_DAYS:" + dayArray[DAYS_30] + " AND o.CloseDate = NEXT_N_DAYS:" + dayArray[DAYS_60]; 
 } else if (currentSource == DAYS_90) {
  soqlClause += " AND o.CloseDate > NEXT_N_DAYS:" + dayArray[DAYS_60] + " AND o.CloseDate = NEXT_N_DAYS:" + dayArray[DAYS_90];
 }
 soql += soqlClause;
 var qr = sforce.connection.query(soql);
 if (qr && qr.size) {
  OppRecords = qr.getArray("records");
  draw();
 } else {
  alert("No results for the selected criteria");
 }
}


function handleCloseDateFilterChanged(closeDateCombo) {
 var closeDateFilter = closeDateCombo[closeDateCombo.selectedIndex].value;
 var result = confirm("You will lose all your changes if any. Click Ok to continue or Cancel to stay");
 if (! result) {
  closeDateCombo.selectedIndex = currentSource;
  return false;
 }
 currentSource = closeDateFilter;
 setTimeout('setupPage()', 100);
}

<body onload="setupPage()" class="opportunityTab detailPage">
<select name="closeDateFilter" onchange="javascript:handleCloseDateFilterChanged(this);">
</body>