• vbcrlfuser
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 26
    Replies

We have 30 accounts with a fax provider. Every two hours we pull the faxes from the provider that arrived since the last run and insert them in to Salesforce.

 

They go in to a custom Fax object with meta-information fields like number of pages, caller id as a parent to an Attachment that is the actual fax. This is all done with a PHP script using the WEB API.

 

Step one is to locate the MAX reference number given to the fax by the vendor  for the given Fax account that Salesforce has seen last. Simple right?

 

SELECT Fax__c.VendorRefNumber__c FROM Fax__c  WHERE Fax__c.VendorAccount__c = '1234' ORDER BY Fax__c.VendorRefNumber__c LIMIT 1

 

This query has been running like a champ for over a year now. The query typically executes in < 200 ms. But for some reason since the last release there will be random times where it takes 30+ seconds and on occasion once or twice a day QUERY_TIMEOUT comes back.

 

Someone may be quick to say a governer limit has been reached cause over time the number of faxes has reached in to the thousands and too many records are being scanned. I would buy that if only someone could explain to me why it doesn't happen every time the query is issued.

 

Not only that but this script alerts me via email it has failed with a query timeout. I immediately jump on the box and kick the same PHP script off manually and the script runs right through all 30 accounts, each query taking less then 200 ms to complete.

 

I've provide a session id, uri, time, date and the exact query in a case but haven't heard anything productive back. Anyone here also know if I provide those items can someone on the support team go in an look at logs to determine exactly why the QUERY TIMEOUT was issue. Thus far my impression with TIER1 support is they cannot.

 

 

 

 

 

 

This bit of APEX used to simply show a picklist with all of the AccountTeamMembers for the account on the case being edited. Of which only one has been configured and there are only 28 members.

 

Now it shows virtually all of the SF user base regardless if they are AccountTeamMembers. Nothing has changed except the 09 upgrade.

 

Anybody see a bug here in my code? Or is this a SF bug?

 

 public class AccountTeamCaseTransferExt {

    private final Case c;

    String teamMember;
 
    public AccountTeamCaseTransferExt(ApexPages.StandardController stdController) {
        this.c = [SELECT Id, AccountID, OwnerId FROM Case WHERE Id = : stdController.getID()];
    }
 
    public PageReference transfer()
    {
    
        if (this.teamMember != NULL)
        {
            c.OwnerId = this.teamMember;
            update c;
            
        }
        
        PageReference pageRef = new PageReference('/' + c.Id);
        pageRef.setRedirect(true);
        return pageRef;
    }
    
    public List<selectOption> getTeamMembers()
    {
        
        List<selectOption> options = new List<selectOption>();
        options.Add(new selectOption('', '-- None --'));
        

        
        if (c.AccountId != NULL) {
            for (User u : [SELECT Id, Name FROM User WHERE Id IN ( SELECT UserId FROM AccountTeamMember WHERE AccountId = : c.AccountId) ORDER BY Name ASC] ) {
              options.Add(new selectOption(u.Id, u.Name));
            }
        }
        return options;
    }
    
    public String getTeamMember()
    {
        return this.teamMember;
    }
    
    public void setTeamMember(String s)
    {
        this.teamMember = s;
    }
     
}

We have 30 accounts with a fax provider. Every two hours we pull the faxes from the provider that arrived since the last run and insert them in to Salesforce.

 

They go in to a custom Fax object with meta-information fields like number of pages, caller id as a parent to an Attachment that is the actual fax. This is all done with a PHP script using the WEB API.

 

Step one is to locate the MAX reference number given to the fax by the vendor  for the given Fax account that Salesforce has seen last. Simple right?

 

SELECT Fax__c.VendorRefNumber__c FROM Fax__c  WHERE Fax__c.VendorAccount__c = '1234' ORDER BY Fax__c.VendorRefNumber__c LIMIT 1

 

This query has been running like a champ for over a year now. The query typically executes in < 200 ms. But for some reason since the last release there will be random times where it takes 30+ seconds and on occasion once or twice a day QUERY_TIMEOUT comes back.

 

Someone may be quick to say a governer limit has been reached cause over time the number of faxes has reached in to the thousands and too many records are being scanned. I would buy that if only someone could explain to me why it doesn't happen every time the query is issued.

 

Not only that but this script alerts me via email it has failed with a query timeout. I immediately jump on the box and kick the same PHP script off manually and the script runs right through all 30 accounts, each query taking less then 200 ms to complete.

 

I've provide a session id, uri, time, date and the exact query in a case but haven't heard anything productive back. Anyone here also know if I provide those items can someone on the support team go in an look at logs to determine exactly why the QUERY TIMEOUT was issue. Thus far my impression with TIER1 support is they cannot.

 

 

 

 

 

 

Hello,

 

We are looking to build a batch update process that would insert a few hundred to a few hundred thousand records in a Salesforce Custom Object.  The Bulk Data Loader API seems a good fit.  The application flow is expected to be - The client initiates this process from a Salesforce VF page which will then make a call to an application on our server which will then initiate the Bulk Loader API and load records for update to SF.  But here is the question- I know that we can pass the session id and serverURL as a part of the initial call to our server.

But can I use the same sessionId and serverURL to start the bulk upload process?  If yes, how long is this sessionId going to be valid?  For large datasets I will be looking to upload multiple batches.

Any ideas?

 

Thanks.

  • March 15, 2011
  • Like
  • 0

Hii, 

 

I am a newbie. I am looking to do integration between GP and SalesForce. 

 

Can somebody provide me starting inputs on how to go about it.

Any kind of documentation would help.

 

thanks,

Mamta  

I would like to include in my application the ability to have automated outbound calls... not for phone solicitations!  Just for appointment reminders.  Can salesforce or a partner app do that?

Hi All,

 

We are about to get a new PBX and I would like to get one that interfaces with SFDC sio that users can click on telephone numbers and connect directly etc.

 

A few years ago there were a few systems that connected to Salesforce pretty much out of the box. Does anyone know what/where that list is today?

 

Thanks

 

Ben

has anybody had any problems with their APEX code with summer 09, mine started workgin in really strange way not like it designed to, it completely runs away in a different direction
  • June 15, 2009
  • Like
  • 0
The StandardSetController (or Database.QueryLocator) ignores the SOQL 'where' clause.

Because QueryLocator can only be used with StandardSetController or in managed sharing recalc, I can't test the it separately to see exactly where the bug lies.

This (simplified) example shows the bug in the StandardSetController context.

I have a custom visualforce page that lists users:

Code:
<apex:page controller="CtlBugPgr" title="Bug">
<apex:form>

<apex:pageBlock title="Users" id="UserList">

<apex:pageBlockTable value="{!data}" var="each">
  <apex:column headerValue="Active?">{!each.IsActive}</apex:column>
  <apex:column headerValue="User">{!each.Name}</apex:column>
  <apex:column headerValue="UserType">{!each.UserType}</apex:column>
</apex:pageBlockTable>

</apex:pageBlock>

</apex:form>
</apex:page>

 The controller for this page uses StandardSetController:

Code:
public class CtlBugPgr {

  //-------------------------------------------------------------------------------
  // User List
  //-------------------------------------------------------------------------------
  public User[] data { get { return (List<User>)pgr.getRecords(); } set; }

  public ApexPages.StandardSetController pgr {
    get {
      if (pgr == null) pgr = initPager();
      return pgr;
      }
    set;
    }
  
  //-------------------------------------------------------------------------------
  // privates
  //-------------------------------------------------------------------------------
  private ApexPages.StandardSetController initPager() {
    ApexPages.StandardSetController ret = new ApexPages.StandardSetController(Database.getQueryLocator(
[select Name, UserType, IsActive from User where IsActive = true and UserType = 'Standard']
));
ret.setPageSize(10); // UPDATED: necessary to reproduce bug!
return ret;
} }

 
Note the two conditions in the where clause of the SOQL.

If I run the query directly via "executeAnonymous" I get what I expect:

Code:
> System.debug([select Name, IsActive, UserType from User where IsActive = true and UserType = 'Standard']);

20081125225927.981:AnonymousBlock.i: line 1, column 1: ( User:{UserType=Standard, IsActive=true, Name=John Hart, Id=...})

 
However, in the visualforce page, all Users are returned:






Message Edited by jhart on 11-26-2008 03:25 PM
  • November 25, 2008
  • Like
  • 0