• Developer_shaan
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 14
    Replies

Hi,

I have a query retrieving the userinfo from user in a trigger.

 

Here i am retrieving a custom field from  user object.

Below is the query: 

 

String userid= userinfo.getUserId();


User[] userType = [select u.custom__c from User u where u.Id=:userid limit 1];

 

the exception is:

Apex script unhandled trigger exception by user/organization: 00540000001RUm8/00D300000001EBY caused by: System.Exception: Too many SOQL queries: 21

 

can anyone whats wrong eith the query to avoid gov limits.

This might be a silly question but i am unable to fix it.

I have an custom object created in sfdc which has more than 1000 records say 10000 records. But i am able to retrieve only 1000 records above that it is throwing an error , so how to  retrieve the 10000 records using soql query.

 

 Note: i dont want to apply limit here. I want to retrieve all the records.

 

Please let me know if any soln for this...

thanks

shaan

can we override a standard lookup icon in salesforce with Visual Force.

If Yes.. Please let me know the steps to acheive this.

 

Thanks

Shaan

I have created an Event and the due date(End Date) for that is say 30 days from today.

I have created a custom field in contact . Now when the event is completed i need to fill this custom field with the completed date of the event.

Is this possible .Let me know if any solution.

Thanks

Issue in apex trigger while retrieving the information from user object.

 

string uid = userinfo.getUserId();

 

User[] user = [select name from User where u.Id = uid];

 

 

for this i am getting an exception in apex trigger as:

 

Too many SOQL queries: 21

I tried using sets but how do we get total collection of userInfo to iterate in for loop and add ids of users to set .

please let me know if any soln.

 

 

I have a string which has value as "24098909090" .Now i need to display the value in thousands.

i.e after every third charcter in a string a comma should be inserted.

Ex: "24,098,909,090" .

 

Is there any solution for this....

How to make use of Javascript or Apex script to handle this kind of issue??

 

Thanks

shaan

I have a string which has value as "24098909090" .Now i need to display the value in thousands.

i.e after every third charcter in a string a comma should be inserted.

Ex: "24,098,909,090" .

 

Is there any solution for this....

How to make use of Javascript or Apex script to handle this kind of issue??

 

Thanks

shaan

How can we limit the below query to a limit of 1000 records.Its throwing too many query rows exception if run directly.

Limit is also not working properly when  applied on queries with aggregate functions.

 

(select  SUM(Field__C) from contact where recordtypeid = ''xyz' );

 

If limit is applied along with groupby clause its is showing an error as Internal Salesforce.com Query Error


(SELECT id, SUM(Field__c) FROM Contact  WHERE recordtypeid = 'xyz' group by id Limit 1000);

 

Is this correct or do we have any other soln.

 

please let me know ASAP.

 

Thanks

shaan

Hi,

 

error while using aggregate function.

System.LimitException: Too many query rows: 58309


SELECT SUM(RI_Production_Goals_Next_Year__c) FROM Contact  WHERE recordtypeid = '012400000005OLAAA2'

 

how to avoid this??

 

 

Hi,

 

I have an apex class which implements system.schedule method .

Within this i call another class which does some update functionality on contact page.

My issue over here is that an update trigger is written for other calculations on the object . i want the trigger not to be fired when the system.schedule method is called.

Is there any soln for this.

If yes please let me know.

 

thanks

shaan

I have an requirement-

 

i have two images which should be invisible by default .

When a button is clicked ,  first button should be visible and second should be in invisible mode.

And when clicked again the second button should be visible.

 

Can we make images invisible by default in VF.

Can anyone help me with soln.

 

Thanks in advance.

 

 

Hello,

 

Using soql query i am able to sort the records. The records are being sorted based on a  field in  asc or descending order.

 

But i am not able to sort the null values.(I.e) when used ascending order the null values should be at the top and when teh order is desc the null values should come at last.

 

Please let me know if any one has soln for this.

 

Thanks

shaan

Hi ,

 

I went through the developers code and some of the examples for Batch Apex.

Here i got the Info about the three methods: start , execute and finish and their uses.

 

I have a query regarding batch apex methods,

 

-In start method i can retrieve  data using SOQL.

-In Execute method data operations are done.

-And in Finish process like sending emails are done.

 

1.Can any one let me know how the operations are carried in execute method. I mean to say if we have to update a batch of records how can we do it using batch apex.

 

2. Do we need to pass the parameters from another apex script for the methods within batch apex class to be executed.

 

 

Please let me know if any solution.

 

Thanks in advance.

Hi,

I have a query retrieving the userinfo from user in a trigger.

 

Here i am retrieving a custom field from  user object.

Below is the query: 

 

String userid= userinfo.getUserId();


User[] userType = [select u.custom__c from User u where u.Id=:userid limit 1];

 

the exception is:

Apex script unhandled trigger exception by user/organization: 00540000001RUm8/00D300000001EBY caused by: System.Exception: Too many SOQL queries: 21

 

can anyone whats wrong eith the query to avoid gov limits.

can we override a standard lookup icon in salesforce with Visual Force.

If Yes.. Please let me know the steps to acheive this.

 

Thanks

Shaan

Issue in apex trigger while retrieving the information from user object.

 

string uid = userinfo.getUserId();

 

User[] user = [select name from User where u.Id = uid];

 

 

for this i am getting an exception in apex trigger as:

 

Too many SOQL queries: 21

I tried using sets but how do we get total collection of userInfo to iterate in for loop and add ids of users to set .

please let me know if any soln.

 

 

I have a string which has value as "24098909090" .Now i need to display the value in thousands.

i.e after every third charcter in a string a comma should be inserted.

Ex: "24,098,909,090" .

 

Is there any solution for this....

How to make use of Javascript or Apex script to handle this kind of issue??

 

Thanks

shaan

Hi,

 

error while using aggregate function.

System.LimitException: Too many query rows: 58309


SELECT SUM(RI_Production_Goals_Next_Year__c) FROM Contact  WHERE recordtypeid = '012400000005OLAAA2'

 

how to avoid this??

 

 

Hi,

 

I have an apex class which implements system.schedule method .

Within this i call another class which does some update functionality on contact page.

My issue over here is that an update trigger is written for other calculations on the object . i want the trigger not to be fired when the system.schedule method is called.

Is there any soln for this.

If yes please let me know.

 

thanks

shaan

I have an requirement-

 

i have two images which should be invisible by default .

When a button is clicked ,  first button should be visible and second should be in invisible mode.

And when clicked again the second button should be visible.

 

Can we make images invisible by default in VF.

Can anyone help me with soln.

 

Thanks in advance.

 

 

Hello,

 

Using soql query i am able to sort the records. The records are being sorted based on a  field in  asc or descending order.

 

But i am not able to sort the null values.(I.e) when used ascending order the null values should be at the top and when teh order is desc the null values should come at last.

 

Please let me know if any one has soln for this.

 

Thanks

shaan

Hello -

 

I'm new to VF and currently we add products to our opportunity records for quoting.

The "Sort" button on the Products related list does not sort by what I need and I was

hoping to create a new page to sort my products by a custom field I created.

Any help is appreciated.

 

Thanks

Hi,

 

     I have a trigger on opportunity update which will update the opportunity line items  accordingly.

 

     Through the debug log I found the trigger is triggered twice, even though I specify it will only be triggered if there is a stage change from sA to sB. 

 

     From the discussion board, I found the reason is due to certain workflow rule did field update right after the trigger. But the funny thing is after the first firing, the previous stage of the opportunity is still considered as sA instead of sB, while the opportunity line items data did accumulated after the firing.

 

     In the end, the number of line items doubled.  Although I have ways to prevent the line items from the second round of accumulation, I am just curious how to deal with the second fire of trigger?

 

 

     Btw, I found the governer limit of SOQL in sandbox increased from 20 to 100! Good news!

 

 

Thanks,

Dawn

Message Edited by dawnzdy on 04-15-2009 12:23 PM