You need to sign in to do that
Don't have an account?
Double Dropdown lists
The SFDC Blog had an article on Double Dropdown lists (options on one picklist dependant on the selection made in another picklist) found at http://crmsuccess.blogs.com/crmsuccess/2005/02/dependent_dropd.html.
(see "Download double_drop_down_example.txt" for code)
I solved a couple of problems I had when a category had no sub category entries, but I'm having trouble solving a problem with the "Update Case Record" function. When I click the "Save" button, nothing happens. I am getting a status value back from the server of 500 rather than 200.
I understand the Summer release in June will have this functionality, but I need it yesterday.
Anyone have a solution?
Anyone have another version of this double dropdown for opportunities or leads (or a list of changes to make it work for opportunities or leads)?
Hi thenslar,
Would you mind posting the bit of code that does the save (updateSFDC i think)?
Here is the code I believe has the problem. It is the original code provided in the Blog (Double Dropdown) and referenced in my previous post above.
I know how these forums sometimes don't do well with code in the text, so if this doesn't come through, email me at tim.hensler@tig.com and I will send the code directly to you.
Thanks for your help.
//Update Case record
try{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){return false;}
xmlhttp.Open("POST",url,false);
xmlhttp.setRequestHeader("Content-Type","text/xml");
xmlhttp.setRequestHeader("soapAction","update");
var xmlUpdateCase = "<?xml version='1.0' encoding='UTF-8' ?>" +
'<soapenv:Envelope ' +
'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ' +
'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '+
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'+
'<soapenv:Header>'+
'<ns1:SessionHeader ' +
'soapenv:mustUnderstand="0" '+
'xmlns:ns1="SforceService">'+
'<ns2:sessionId' +
' xmlns:ns2="urn:enterprise.soap.sforce.com">{!API_Session_ID}'+
'</ns2:sessionId>'+
' </ns1:SessionHeader>'+
'</soapenv:Header>'+
'<soapenv:Body>' +
'<update xmlns="urn:enterprise.soap.sforce.com">'+
'<sObjects xsi:type="ns3:Case" '+
'xmlns:ns3="urn:sobject.enterprise.soap.sforce.com">'+
'<ns3:Id>{!Case_ID}' +
'</ns3:Id>'+
'<ns3:Category__c>'+Categorystr+
'</ns3:Category__c>'+
'<ns3:Sub_category__c>'+Subcategorystr+
'</ns3:Sub_category__c>'+
'</sObjects>' +
'</update>' +
'</soapenv:Body>'+
'</soapenv:Envelope>';
//alert(xmlUpdateCase);
document.write(xmlUpdateCase);
xmlhttp.Send(xmlUpdateCase);
var sq = xmlhttp.status;
if ( sq == 200){
return true;
}
else{
alert('='+sq);
return false;
}
}
Hi thensler,
For the SoapAction header, just put "" instead of "update". Not sure why, but I think the SoapAction will cause issues. Also, what is the value of the url variable in the Open command?
The url value is set in the statement:
var url = "{!API_Enterprise_Server_URL_40}";
I changed the Open statement as you suggested and tried both the 4.0 and 5.0 enterprise servers in the "url" above and still get the same results as before.
the soapAction header value should be "" (the actual string quote quote, not an empty string, xmlhttp.setRequestHeader("soapAction","\"\"")).
Typically an update call returns an array of SaveResult's not a fault, so the HTTP status code is going to be 200, you'll need to look at the response XML to work out what's going on.
Message Edited by SimonF on 05-03-2005 08:53 AM
Message Edited by SimonF on 05-03-2005 08:53 AM
I don't know why but for me it works
Regards
I applied SimonF's and The_Fox's suggestions above and I got a new message: "URL No Longer Exists" so I will go back in and review all url references. I thought this was a plug and play script from the CRM Success blog, but am finding it a bit challenging for my meager programming skills.
Thank you SimonF and The_Fox for your help.
Try putting your case id field in a variable. I have no explanation but I am not passing directly any merge fields, I always put them in a var due to some issues exposed with the session ID.
Regards.
Does anyone have a version of this that I can just copy and paste that works?
Thanks
Richard Carrey
Linda
1) Create a new scontrol and instead of putting the real text in the HTMLBody field just put short text like "test"
2) Click save
3) Click Edit, remove your short text and paste in the actual text for the HTMLBody field