• RJoshi
  • NEWBIE
  • 0 Points
  • Member since 2009

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

hi,

 

I am querying a table ' expense reports ' for sum of  a field expenses using aggregate function  ,groupy by owner id of expense reports. I am using a wrapper class to display Owner's name and sum of its expenses. But when the code gets executed i get an error "System.SObjectException: Invalid field Owner for AggregateResult".

  

My Code:

  

//Definition / Constructor for Wrapper class
 public class wrapER
 {
  public String ContractorName{get;set;}
  public Integer TotalAmount{get;set;}
  
  public wrapER( String con, Integer amt)
  {
   ContractorName = con;
   TotalAmount = amt;
  }
 }

//Variable Declaration
 public List<wrapER> wrER = new List<wrapER>();


public wrapER[] getwrER()  
 {        
      
  wrER =  PETController();           
       return wrER;  
 }
public List<wrapER>  PETController(){

List<aggregateResult> results_agg  = [select Owner.name,  SUM(Total_Amount_Expense_Item__c)  from Expense_Report__c where Project__c = :proj.id and Status__c = 'Approved'   Group by Owner.name];

for( integer i =0; i< results_agg.size();i++   )
{
  wrER.add(new wrapER(String.valueOf(results_agg[i].get('Owner')),Integer.valueOf( String.ValueOf(results_agg[i].get('expr0')))));
}
System.debug('**********res**' +results_agg);
return null;
}

  

 

Any idea  how can i fix this error.

 

 

 

Thnaks in advance

RJoshi

  • August 27, 2010
  • Like
  • 0

Hi

 

There is a new feature called custom properties in salesforce.Anybody has any idea about this feature.

Or any pointers where i can read about this.Please let me know.

 

Thanks in advance

Swati

hi

 

I am calculating due date with help of buisness hour class , my due date is 3.5 hrs ahead of some x date.

 

But addgmt method does not accept the decimal values . Is there any other alternative to give time in minutes .

 

Thanks

Swati

  • December 04, 2009
  • Like
  • 0

hi

 

I m calculting date with help of buisness hour class and assigning it due date of task . but some data type issue is coming.

My code:

 

DueDate= BusinessHours.addGmt(stdBusinessHours.id,dt , 23 * 60 * 60 * 1000L);
     
     ActivityDueDate = Date.valueof(DueDate);
    

    Task taskIns = new Task (OwnerId = '00570000001R8mS' ,Subject = 'Coordinate Shipment Refill',Priority = 'Normal'  ,  Activity_Type_gne__c = 'Coordinate Shipment Refill' , ActivityDate = ActivityDueDate );                         
    tsk_insert.add(taskIns);

 

Im getting this error Invalid date: java.util.GregorianCalendar .

 

Can anybody tell me correct method to convert datetime field into date.

 

Thanks inadvance

Swati

 

  • December 03, 2009
  • Like
  • 0

hi

 

I have to  create workflow rules , where i need to create a task after two days if certain conditions are met.

Now the problem is if it is thursday i need to create a task on monday and if it is friday task should get created on tuesday.I want a way were all this date calculation take into account weekends.

 

Plz letme know if you have any idea.

 

 

Thanks in advance

rjoshi

  • November 13, 2009
  • Like
  • 0

hi,

 

I am facing problem in installing Force.com IDE for Eclipse 3.3.x .

 

As per steps mentioned for  Force.com IDE Installation for Eclipse 3.3.x

I am facing problem at step 3 which is

 

Add the Force.com IDE Remote Site:

1. Launch Eclipse, and then click Help > Software Updates > Find and Install.

2. Select "Search for new features to install" and click "Next".

3. Add the Force.com IDE Remote Site:


Click "New Remote Site". The New Update Site dialog opens.
Set the Name to "Force.com IDE" and the URL to "Link: ", then click OK.
Select “Europa Discovery Site” and "Automatically select mirrors”, then click “Finish”. Eclipse will search the selected sites for the required plugins.
here at "Link:" =  "http://www.adnsandbox.com/tools/ide/install/" link nothing is there except a redirection link to Force.com IDE Installation for Eclipse 3.3.x  is there

thats why Eclipse Update Manager is showing error as follow :

Network connection problems encountered during search.


  Network connection problems encountered during search.
  Unable to access "http://download.eclipse.org/releases/europa".
    Error parsing site stream. [Premature end of file.]
    Premature end of file.
    Error parsing site stream. [Premature end of file.]
    Premature end of file.
  Unable to access "http://www.adnsandbox.com/tools/ide/install/".
    Error parsing site stream. [Premature end of file.]
    Premature end of file.
    Error parsing site stream. [Premature end of file.]
    Premature end of file.


Can anybody help me to get Force.com paltform installed.

Thanking in advance.

 

Rjoshi

  • November 11, 2009
  • Like
  • 0

hi

 

I want to put a label on page layout such that it does not map to any field in data base.

Is it possible , if yes then how??

 

Thanks in adavnce

Rjoshi

  • November 03, 2009
  • Like
  • 0

hi

 

I m creating a text field , i want to give the label as blank.

But label is  mandatory and it is not accepting space.

Is there any alternative.

 

 

Thanks in advance

Rjoshi

  • November 03, 2009
  • Like
  • 0

hi

 

picklists fields  are taking an unusually long time to respond on VF pages in IE 7, but they are responding immediately in firefox .

 Any idea why this is happening and  and how this can be corrected. 

 

Thanks is adavnce

Rjoshi

 

 

 

Message Edited by RJoshi on 10-23-2009 03:51 AM
  • October 23, 2009
  • Like
  • 0
hi , Can i enable and disable fields on a visualforce page , based on some conditions? If yes , Please let me know how ? Thanks Rjoshi

Hi,

 

I want to hide records visible in related list , on basis of some filter criteria .

Is it Possible. If yes please let me know how ?

 

Thanks in advance

Ritika

Hi

    I am facing problem in installing Force.com IDE for Eclipse 3.3.x .

As per steps mentioned for  Force.com IDE Installation for Eclipse 3.3.x

I am facing problem at step 3 which is

Add the Force.com IDE Remote Site:

1. Launch Eclipse, and then click Help > Software Updates > Find and Install.

2. Select "Search for new features to install" and click "Next".

3. Add the Force.com IDE Remote Site:
  • Click "New Remote Site". The New Update Site dialog opens.
  • Set the Name to "Force.com IDE" and the URL to "Link: ", then click OK.
  • Select “Europa Discovery Site” and "Automatically select mirrors”, then click “Finish”. Eclipse will search the selected sites for the required plugins.
here at "Link:" =  "http://www.adnsandbox.com/eclipsetoolkit/release" link nothing is there except a redirection link to Force.com IDE Installation for Eclipse 3.3.x  is there

thats why Eclipse Update Manager is showing error as follow :

Network connection problems encountered during search.


  Unable to access "http://download.eclipse.org/releases/europa".
    Error parsing site stream. [Premature end of file.]
    Premature end of file.
    Error parsing site stream. [Premature end of file.]
    Premature end of file.
  Unable to access "http://www.adnsandbox.com/eclipsetoolkit/release".
    Error parsing site stream. [Premature end of file.]
    Premature end of file.
    Error parsing site stream. [Premature end of file.]
    Premature end of file.


Can anybody help me to get Force.com paltform installed.

Thanking in advance.