You need to sign in to do that
Don't have an account?
vivinmathew
Cannot retrive records
Hi,
I have developed a custom control which retrieves the threads posted in a custom object called Threadsnew_c.
I am in the process of developing a discussion forum in SFDC.
I able to retrive records when this query is executed in sfore xplorer. I have made this scontrol as a custom web control and when i run it from the interface that is SFDC i get values which says 'undefiend'.
Can someone please help me.
I have attached my coding HTML script with this.
Regards,
VIvin MathewCode:
I have developed a custom control which retrieves the threads posted in a custom object called Threadsnew_c.
I am in the process of developing a discussion forum in SFDC.
I able to retrive records when this query is executed in sfore xplorer. I have made this scontrol as a custom web control and when i run it from the interface that is SFDC i get values which says 'undefiend'.
Can someone please help me.
I have attached my coding HTML script with this.
Regards,
VIvin MathewCode:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>SalesForce SControl</title> <link href="/dCSS/Theme2/default/common.css" type="text/css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet" > <link href="/dCSS/Theme2/default/custom.css" type="text/css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet" > <script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js—browser=true" type="text/javascript"></script> <script type="text/javascript" src="/js/functions.js"></script> <script language="javascript"> <!-- //Page initialization is a good idea. function initPage() { sforceClient.registerInitCallback(pageSetup); //Including the two merge fields below will enable this sforce control when used in your account. sforceClient.init("{!API.Session_ID}", "{!API.Partner_Server_URL_70}", true); } function pageSetup() { //Simple query call //var qr = sforceClient.query("Select CreatedDate, Id, Name, Threadsnew_subject__c,Threadsnew_body__c from Threadsnew__c order by CreatedDate DESC"); SearchString="Select CreatedDate, Id, Name, Threadsnew_subject__c,Threadsnew_body__c from Threadsnew__c order by CreatedDate DESC"; var queryResult = sforceClient.Query(SearchString); //if (qr.className == "QueryResult") { // BUILD TABLE HEADER var output = "<table width=’100%’ class=list border=’0’ cellspacing=’0’ cellpadding=’0’><tr class=headerRow height=20>"; output += "<th nowrap’>Thread Subject</th>"; output += "<th nowrap’>Author</th>"; output += "<th nowrap’>Posted Date</th></tr>"; //BUILD TABLE ROWS for (var j = 0; j < queryResult.records.length; j++) { var Threadsnew__c = queryResult.records[j]; output += "<tr onmouseover=hiOn(this) onmouseout=hiOff(this)>"; output +="<td><a href=’/"+Threadsnew__c.Id+"’ target=_parent>" + Threadsnew__c.Threadsnew_subject__c + "</a></td>"; output += "<td>" + Threadsnew__c.Name+ "</td>"; output += "<td>" + Threadsnew__c.CreatedDate+ "</td></tr>"; } output += "</table>"; document.getElementById("divMain").innerHTML = output; } //} //--> </script> </head> <body onload="initPage();"> <BODY class="account"> <form name=AccountSearchForm"> <DIV class=bPageTitle> <DIV class="ptBody secondaryPalette"> <DIV class=content><IMG class=pageTitleIcon alt=Account src="/s.gif"> <H1 class=pageType>General<SPAN class=titleSeparatingColon>:</SPAN></H1> <H2 class=pageDescription>Discussion Boards</H2> </DIV></DIV></DIV> <DIV class="bPageBlock secondaryPalette"> <DIV class=pbBody> <DIV class=pbSubsection> <div id="divMain"></div> </form> </DIV></DIV></DIV> </body> </html>
if you can switch to this new, suported toolkit, it will be much easier to debug the issue, probably take no more than an hour to switch.
Can you please help me or guide me to how to switch to the new tool kit.
Thanks,
Vivin Mathew
==========
https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js
/soap/ajax/9.0/connection.js
sforceClient.init({!API_Session_ID}", "{!API_Partner_Server_URL_70}")
- Root variable
- Beta Value:
- Change to this value:
- Entity object
- Beta Value:
- Change to this value:
So, the header for my latest scontrol looks like thissforceClient
sforce.connection
DynaBean
sforce.SObject
Code:
and the setup code looks like this, note no init() for the toolkit this is done for you
Code:
Be sure to access the query results records using getArray()
Code:
And here is my caching version of describe, which is not included in the base toolkit but i needed a cache for this call ( i probably should have used a different namespace, but it works..)
Code:
And, looks like my function toUpdateFieldNames() got pasted in, so here it is also
Code:
Message Edited by Ron Hess on 04-03-2007 07:50 AM