• JKinsey
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I am attempting to produce a custom VFpage that lists only opportunities within the next year.  I'm building an extension to return list views but within my filter criteria.

My issue lies with "And inputdate__c < ??? Today + 365", as seen below from the extension.

I'd rather not create a custom field for Now()+365....

 

 

public List<Opportunity> getOpptySum() {
        return [select name,closedate,account_id__c,inputdate__c,stagename,isclosed
         from Opportunity WHERE account_id__c = :ApexPages.currentPage().getParameters().get('id') 
                             AND isclosed <> true
                             AND inputdate__c < ??? TODAY + 365 Days
                             ORDER BY inputdate__c ASC 
                             LIMIT 50 ]; 
        }

 

 

 

I am attempting to produce a custom VFpage that lists only opportunities within the next year.  I'm building an extension to return list views but within my filter criteria.

My issue lies with "And inputdate__c < ??? Today + 365", as seen below from the extension.

I'd rather not create a custom field for Now()+365....

 

 

public List<Opportunity> getOpptySum() {
        return [select name,closedate,account_id__c,inputdate__c,stagename,isclosed
         from Opportunity WHERE account_id__c = :ApexPages.currentPage().getParameters().get('id') 
                             AND isclosed <> true
                             AND inputdate__c < ??? TODAY + 365 Days
                             ORDER BY inputdate__c ASC 
                             LIMIT 50 ]; 
        }

 

 

 

I need help in creating a formula that maintains a rolling 3 month and 6 month average qty of products sold.  I want to display these two results in a column at the end of a matrix report.

 

 

Columns:       Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 3MonAve 6MonAve

 

Rows:

Product A       

Product B

Product C

 

Has anyone done this?