• Machhi
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 11
    Replies

Hi,

 

Has anybody come across below issue with Salesforce?

 

The batch Apex job processed 5 batches with 0 failures.

 

Error I am getting is:

Update failed. First exception on row 0 with id 001Q0000005U7c4IAC; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, trigAccount: execution of BeforeUpdate caused by: System.Exception: Too many SOQL queries: 201 Class.AssetUtility.GetAssetsForAccount: line 109, column 30 Class.AccountUtility.ResetFlagOnUpdate: line 236, column 30 Trigger.Account: line 29, column 17: []

I have traced following things:  

Error record number on which I am getting error: 600

 

Total records to be processed :678

 

Query being used by Batch Apex:select Id, Number_of_Cases__c, Number_of_Contracts__c from Contact

 

This application has simple task to updat account records. Below is the code in the Execute call:

/* Execute : This function performs Batch Update process */ global void execute(Database.BatchableContext BC, List<sObject> scope) { /* Loop through each records list as per the Query paramater. Perform the updates */ List<Account> accountsToUpdate = new List<Account>{}; try { for(sObject s : scope) { Account a = (Account)s; if(blnIsIncludeNumberOfCases) a.Number_of_Cases__c = [select count() from Case where Account.id = :a.id]; if(blnIsIncludeNumberOfContracts) a.Number_of_Contracts__c = [select count() from Contract where Account.id = :a.id]; AccountsToUpdate.Add(a); iCountForAccount++; } //Update all accounts in batch update AccountsToUpdate; } catch(Exception e) { iErrorRecordNumber = iCountForAccount; strMessage = 'Error with Batch Apex : ' + e.getMessage() + '<br />Error record number: ' + iErrorRecordNumber; } } //End of Execute

 

This seems like Salesforce governance limit, bt I need to know how to overcome this.

  

Please help.

 

Regards,

Chandrakant M

I am using the below formula 

 

IF(ISBLANK( VALUE( Currency__c )), Amount_Spent__c, Amount_Spent__c * 50)

 

Formula return type is a number.  Currency__c is a lookup and Amount_Spent__c is a number field. For true ie if Currency__c is blank then it returns the desired value. But for an false condition it is returnin #error.

 

What is wrong with this formula can any one help me.

 

Regards

Sankar

I am new to Salesforce and need to create the following validation rule formula.  The formula requires a value in the case comments that matches the account name related to the case.  (i.e. if the case is assigned to an account named ABC, the user must enter the phrase "ABC" in the case comments for the entry to be valid.)

 

Please help!

Aside from the free app on appxchange, has anyone created/used/purchased an map building add-ins for salesforce? I'm looking to provide our sales teams with collaborative maps that are easy to use, visually helpful and customizable.

Any info would be greatly appreciated. 

Thanks,

RRC

Hello All,

 

I am looking to implement SSO for my organization, I need to give an estimate of the level of effort involved here.  Can anyone please provide me with some feedback around how long I can expect this to take either using the native WSDL file of SFDC or using an App like Ping Connect?  I am integrating with our LDAP.  Please help!!! Thanks much!  

 

I know it's unconventional but if someone who is experienced in SSO would be willing to have a 5 minute phone call I would be forever greatful!

Hi All,

 

I am facing problems with mass updates of records module design. I had to change my appl design in lot of way because of below scenario:

 

Scenario:

I need to update mass contact records based on filter criteria. Fields to be updated are the count of number of cases and activities against the respective contact records.

 

How it works:

I have a Visualforce page from where I call a method from the custom controller class.

 

This method queries on contact records based on filter criteria. Divide them into the quantitative batches. Collects a set of Ids for one batch and pass it to future method (asynchronous).

 

Issue:

1. Even though I am using future method, I get “Too many SOQL queries: 101” error.

I learnt that a future method allows me to work on 10,000 SOQL queries or DML statements (http://wiki.developerforce.com/index.php/Governors_in_Apex_Code).

 

Due to this, I can work only on a batch of 99 records.

Shouldn’t it be 10,000 SOQL queries which I can process in future method called through Visualforce controller?

 

2. If I activate trigger, this batch size is still decreased as execution of trigger also adds SOQL queries.

 

I don’t understand why execution of trigger adds SOQL queries to my future method limit. Even it adds to it, why it throws error after 100 SOQL queries? Also, I am also looking for an option by which I can stop trigger from being executed if I am updating records from my Visualforce controller. Having a flag field and check its value inside trigger work around is sarcastic.    

 

Please help. Salesforce looks quite intelligent to answer mass records updates requirement using future annotation but as I have experienced up to now, I can process only 700-800 records successfully not more than that which is simply not acceptable.

 

Regards,

Chandrakant M

machhi_c_m@yahoo.com

Message Edited by Machhi on 10-09-2009 12:27 AM
Message Edited by Machhi on 10-09-2009 12:28 AM

I know there is a wealth of information out here on this and I am studying, but I haven't figure it out yet.

 

Do I just need to use a loop like this?

 

 

for(List<Account> a : [select id from Account where IsDeleted=false]){delete a;}

 

 

 

Hi,

 

As you all know Salesforce is phasing out s-control next year, so I am given the task to convert one functionality written in S-control to VF page.

 

My object is select more then 10000 records from the object (lets say my object 30000 records). Even consider by applying all filter criteria SOQL still need to fetch more than 10000 rows.

 

But when I try to select more then 10000 records using SOQL, apex throw a limit exception to me.

So any idea how we can select more then 10000 records in VF/Apex solution.

 

Any suggestion is appreciable.

 

Thanks

Rajan

Hi,
 
    We are trying to implement SSO from our Intranet using the SalesForce Delegated authentication model.  We have covered a lot of steps and seems like are close to having this functionality but are running into the following issue -
 
    When the user clicks on GoTo SalesForce link from our Intranet, we receive the Delegated authentication callback and return true to validate the token.  Next, the users browser displays a blank page with a URL such as the following -
 
 
     It appears that the user session is established, because I can manually change this URL to https://na3.salesforce.com/home/home.jsp and the user is logged in.  But I am not sure how to make the browser automatically endup in this URL.
 
    Thanks for any suggestions,
 
Vijay