• Drawloop
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 10
    Replies
I would like to be able to start with showing records 1-200 from a particular query, then when a button is clicked show records 201-400. Here is what I have so far:

Code:
apex.batchSize = 200;
var d:QueryResultIterator = new QueryResultIterator(apex, querystr,
 function (so:SObject):Boolean
 {
  var qr:QueryResult = d.queryResult();
  for (var i:int = 0; i < qr.records.length; i++)
  {
   var q:QueryResult = (qr.records[i] ? qr.records[i] : qr.records);
   //display record
  }
  return false;
 }
);

This gets me the first set of records fine but when I run this code a second time it still gives me the first results. What am I missing? Do I have to use an event listener?

Thanks!

Tracy
Using Javascript, we try to do something simple like:
var query = sforce.connection.query("SELECT Id FROM WebLink WHERE Name='###' AND PageOrSobjectType='###'")
but not all users can query the WebLink table. Is it a setting in the profile? Why wouldn't a user have access to this table, especially if they have access to the s-controls table?
I'm using JavaScript to do some Salesforce field updates then open a URL in the same window with a side bar. The following is the last line of JavaScript that calls the button which calls an s-control:
 
location.href="/servlet/servlet.Integration?scontrolCaching=1&lid=00b00000006onut&eid=a02000000007USx";

 The lid is the button and the eid is the custom object that the button is being called from. The button opens a link to our service inside the existing window with a sidebar. (The only reason I'm calling this button inside the JavaScript is that I don't know a way to open the URL in this same manner.) Our service tries to create a Salesforce object using the session id of the user as the creator of the object. It is at this point that we get the 'Invalid Session Id - session id has timed out' error. I've logged in as two different users and the session id is the same and I don't think it should be. My guess is that the above link was created specific to that session id, but I don't see how that's possible.
 
Any thoughts on how to fix or get around this? Much appreciated.

how can i change the "select record type" page into a visualforce page
and when i click continue in my new visualforce page it will continue to the regular edit-mode page
 
  • August 07, 2008
  • Like
  • 0
I would like to be able to start with showing records 1-200 from a particular query, then when a button is clicked show records 201-400. Here is what I have so far:

Code:
apex.batchSize = 200;
var d:QueryResultIterator = new QueryResultIterator(apex, querystr,
 function (so:SObject):Boolean
 {
  var qr:QueryResult = d.queryResult();
  for (var i:int = 0; i < qr.records.length; i++)
  {
   var q:QueryResult = (qr.records[i] ? qr.records[i] : qr.records);
   //display record
  }
  return false;
 }
);

This gets me the first set of records fine but when I run this code a second time it still gives me the first results. What am I missing? Do I have to use an event listener?

Thanks!

Tracy
Hello,
 
Can somebody please assist with the following query?
 
I have a custom object called "Meeting_Notes__c" that has an opportunity lookup on the page (not required). I would like to place a detail button that uses the JavaScript Onlick event at the top of the Meeting_Notes__c page.
 
If an opportunity has been entered I need to open the opprotunity edit page and update the opportunities "Next Step" and "Current Status" fields with data from the active meeting note record.
 
If there is not an opportunity I would like to alert the user that there is not a related opportunity and return to the active meeting note record.
 
This is what i have so far.
 
---------------------------------------------------------------------------------------------------------------------
 
{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}
 
//establish connection to SF
var connection = sforce.connection;

//Query meeting note and retrieve related Opportunity ID
var meetingnoteId = "{!Meeting_Notes__c.Id}";
var qr = connection.query("Select Meeting_Notes__c.OpportunityId__c From Meeting_Notes__c
Where Meeting_Notes__c = '" + meetingnoteId + "'");
 
//Declare Opportunity variable
var meetingnoteOpp ="{!Meeting_Notes__c.OpportunityId__c}";
 
//If an opportunity is populated edit opportunity else alert user that there is not an opportunity
if (meetingnoteOpp != 'NULL')
 {
       open(https://tapp0.salesforce.com/{!Meeting_Notes__c.OpportunityId__c}/e?retURL=%{!Meeting_Notes__c.OpportunityId__c}&opp10={!Meeting_Notes__c.Next_Step__c}&00N30000001B3x7={!Meeting_Notes__c.Current_Status__c})
 }
else
 {
       alert("This is a test")
 }
)
 
--------------------------------------------------------------------------------------------
 
Thank you in advance - MLee
  • October 30, 2007
  • Like
  • 0
Does anyone know a way around the restriction of Salesforce.com's requirement to use enterprise edition in order to use the API?

My customers have professional edition and don't want to upgrade to enterprise yet they want to merge functionality with other premise based systems which requires the API.

Is there a way to turn on the API with professional API?

Any work arounds?

Thanks!
  • October 19, 2007
  • Like
  • 0
Using Javascript, we try to do something simple like:
var query = sforce.connection.query("SELECT Id FROM WebLink WHERE Name='###' AND PageOrSobjectType='###'")
but not all users can query the WebLink table. Is it a setting in the profile? Why wouldn't a user have access to this table, especially if they have access to the s-controls table?
I'm using JavaScript to do some Salesforce field updates then open a URL in the same window with a side bar. The following is the last line of JavaScript that calls the button which calls an s-control:
 
location.href="/servlet/servlet.Integration?scontrolCaching=1&lid=00b00000006onut&eid=a02000000007USx";

 The lid is the button and the eid is the custom object that the button is being called from. The button opens a link to our service inside the existing window with a sidebar. (The only reason I'm calling this button inside the JavaScript is that I don't know a way to open the URL in this same manner.) Our service tries to create a Salesforce object using the session id of the user as the creator of the object. It is at this point that we get the 'Invalid Session Id - session id has timed out' error. I've logged in as two different users and the session id is the same and I don't think it should be. My guess is that the above link was created specific to that session id, but I don't see how that's possible.
 
Any thoughts on how to fix or get around this? Much appreciated.

Hi all,
 
Can anyone answer this?
 
If a Customer with SF-Professional license embeds the (signed) applet into S-Control and forwards API Fields “API Session ID” and “API Enterprise/Partner Server URL” as parameters to this applet, will this customer be able to execute API calls from this applet without additional authorization and authentication (using just Session ID and Server URL)? If yes, which server URL does the customer has to use – Enterprise or Partner?
 
Thanks in advance,
 
IGS