• JohanButs
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
I have a question about the integration between the partner portal toolkit, which is written in java, with our already available portal to customers (written in php).

We want to make salesforce data available to portal users but also provide custom pages which are written in php.

I wonder how we can fix the problem of signing in 2 pieces:
- once for our own portal (php)
- once for the salesforce portal (java)

Is there anybody who has experience with this or has knowledge of closing the gap between php and java ?

many thnx in advance

*** IS ALSO POSTED THIS MESSAGE IN THE PHP FORUM *****
I have a question about the integration between the partner portal toolkit, which is written in java, with our already available portal to customers (written in php).

We want to make salesforce data available to portal users but also provide custom pages which are written in php.

I wonder how we can fix the problem of signing in 2 pieces:
- once for our own portal (php)
- once for the salesforce portal (java)

Is there anybody who has experience with this or has knowledge of closing the gap between php and java ?

many thnx in advance

I also posted this thread in the java forum but i didn't get any response there so i'll try it here. I have a problem concerning the query method in the ajax toolkit (both tested with beta 1 and beta 2). What i want to do is the following: I want to create a treeview with different categories and each categorie has his items. So i build up my own control instead of using other be just hiding en showing divs. An example of a simple tree looks like this:

Code:

<DIV id=category>category</DIV>
  <DIV id="categoryitems" onclick="setChecks(this);">
    <DIV id=item1><INPUT id=citem1 type=checkbox>item1 in category</DIV>
    <DIV id=item2><INPUT id=citem2 type=checkbox>item2 in category</DIV>
  </DIV>

 

When i click on category i have the following code that query's for each item in the categoryitems section for that category:

Code:

function setChecks(parentobj) {	 //parentobj = categoryitems	
	var pobj = parentobj;
	var counter = pobj.childNodes.length;   //= 2
	for (i=0;i<counter;i++) {
		var parchild = pobj.childNodes[i];
		query(parchild.id);				
	}	
}


 Code:

function query(id) {
	document.getElementById("erroroutput").innerHTML += "<br> Select Id from Node_Item__c Where Account__c = '{!Account_ID}' And Path__c = '" + id + "'";
	var qr = sforceClient.Query("Select Id from Node_Item__c Where Account__c = '{!Account_ID}' And Path__c = '" + id + "'");
	
	if (qr.getClassName() == "QueryResult") { 
		if (qr.size > 0) {
			document.getElementById("erroroutput").innerHTML += "<br><b>found for:</b>" + id + qr.records[0].get("Id");
			//normally i set the checkbox for that item to true
		} else {
			document.getElementById("erroroutput").innerHTML += "<br><b>not found for:</b>" + id;
			//i set the checkbox for the item to false
		}
	} else {
		document.getElementById("erroroutput").innerHTML += "<br><b>no valid queryresults found for:</b>" + id;
	}					
}

 

In the query method i simply output some debug info into a div. Before showing the result, i have for the 2 items (with id=item2 and id=item1) a record in salesforce so they exist. The result in the debug div output when i execute is the following:

Select Id from Node_Item__c Where Account__c = '00130000009onzj' And Path__c = 'INST_BASE_INF_NAPP' found:INST_BASE_INF_NAPPa0330000000jisDAAQ

This is ok but then it stops my for loop and doesn't execute the query anymore for the second item although there is a record. The weird thing is when i only debug and not call the sforceClient.query() it does the loop 2, so i think the problem doesn't exist in my code but in the query method. Is this a known bug or am i using bad code ?

In this code below i get a weird behaviour with my for loop. The code i commented and labeled 'THIS CODE SKIPS MY LOOP ONCE' is the section that gives the problem.

What i wanted to do is the following: i have one div with an id and when i click that div a section with items related to that div opens. The items related to that div have a checkbox, which must be checked if a certain record is found in the data tabel (Node_Item = custom object). The query works fine and it works. But it always skips my loop once.

example: i have a div with 4 related items. So i click the div and
- parentobj.childNodes.length = 4 OK
- i = 0
- it goes to the first item in the loop (parchild)
- it goes all the way down to the query because it's valid and it check's the checkbox because a record was found in the table

but then comes the weird thing: when i echo i in the next loop it says 2, so it skipped 1

Is this a problem in the toolkit or my code because i don't use a break or continue statement and when i comment the query code the loop works fine.

Can anybody help me ?



function setChecks(parentobj) {

for (i=0;i
var parchild = parentobj.childNodes[i];
strparchild = new String(parchild.id);
//EXCLUDE _ITEMS SECTION
if (strparchild.search('_ITEMS') != -1) {
//IS EEN COLLECTIE SECTIE
} else {
if (parchild.getAttribute('hasitems') == 'yes') {

} else {
//THIS CODE SKIPS MY LOOP ONCE
window.alert(parchild.id);
//var qr = sforceClient.Query("Select Id from Node_Item__c Where Account__c = '{!Account_ID}' And Path__c = '" + parchild.id + "'");
//if (qr.size == 1) {
//check=document.getElementById("C_" + parchild.id);
//check.checked = true;
//check.setAttribute("rec_id", qr.records[0].get("Id"));
//}
}
}
}
}
I have a question about the integration between the partner portal toolkit, which is written in java, with our already available portal to customers (written in php).

We want to make salesforce data available to portal users but also provide custom pages which are written in php.

I wonder how we can fix the problem of signing in 2 pieces:
- once for our own portal (php)
- once for the salesforce portal (java)

Is there anybody who has experience with this or has knowledge of closing the gap between php and java ?

many thnx in advance
In this code below i get a weird behaviour with my for loop. The code i commented and labeled 'THIS CODE SKIPS MY LOOP ONCE' is the section that gives the problem.

What i wanted to do is the following: i have one div with an id and when i click that div a section with items related to that div opens. The items related to that div have a checkbox, which must be checked if a certain record is found in the data tabel (Node_Item = custom object). The query works fine and it works. But it always skips my loop once.

example: i have a div with 4 related items. So i click the div and
- parentobj.childNodes.length = 4 OK
- i = 0
- it goes to the first item in the loop (parchild)
- it goes all the way down to the query because it's valid and it check's the checkbox because a record was found in the table

but then comes the weird thing: when i echo i in the next loop it says 2, so it skipped 1

Is this a problem in the toolkit or my code because i don't use a break or continue statement and when i comment the query code the loop works fine.

Can anybody help me ?



function setChecks(parentobj) {

for (i=0;i
var parchild = parentobj.childNodes[i];
strparchild = new String(parchild.id);
//EXCLUDE _ITEMS SECTION
if (strparchild.search('_ITEMS') != -1) {
//IS EEN COLLECTIE SECTIE
} else {
if (parchild.getAttribute('hasitems') == 'yes') {

} else {
//THIS CODE SKIPS MY LOOP ONCE
window.alert(parchild.id);
//var qr = sforceClient.Query("Select Id from Node_Item__c Where Account__c = '{!Account_ID}' And Path__c = '" + parchild.id + "'");
//if (qr.size == 1) {
//check=document.getElementById("C_" + parchild.id);
//check.checked = true;
//check.setAttribute("rec_id", qr.records[0].get("Id"));
//}
}
}
}
}