• queondaguero
  • NEWBIE
  • 25 Points
  • Member since 2011

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

Hello,

 

I am a new admin to SF and looking for some quick help if possible.  Just started to dive in to VR's in SF.  Trying to create a rule that prevents saving opportunity unless another drop down field is changed to a different stage.

 

Logic goes something like this: 

 

If ISPICVAL StageName "Order Closed" is selected, then the ISPICVAL CSSR_Status_c "Entered in SP" needs to be selected before allowing to save the Opportunity.

 

Thank You in advance!

I'm brand new to Apex and I'm having some trouble displaying aggregate results in a visualforce page. The extension isn't throwing any errors but the visualforce says "Error: Invalid field cv__Opportunity__c for SObject AggregateResult".

 

The way I read this is, either I'm not calling the fields properly in the visualforce page, or I'm not presenting the aggregate properly in the extension. Any help is of course greatly appreciated!

 

Here's the extension:

public class AccountDesignationHistoryExtension {
    
    Account CurrentAccount = null;
    List<AggregateResult> AccountDesignationHistory = null;
    
    public AccountDesignationHistoryExtension(ApexPages.StandardController controller) {
        CurrentAccount = (Account)controller.getRecord();
        AccountDesignationHistory = [SELECT COUNT(cv__Opportunity__c), Designation_Name__c, SUM(cv__Amount__c), MAX(Close_Date__c)
        From cv__Donation_Designation_Relationship__c
        WHERE cv__Opportunity__r.AccountId = :CurrentAccount.Id
        AND cv__Opportunity__r.StageName = 'Received'
        AND cv__Opportunity__r.cv__Posted__c = False
        GROUP BY Designation_Name__c];
    }
    
    public List<AggregateResult> getAccountDesignationHistory() { return AccountDesignationHistory; }
    
}

Here's the visualforce:

<apex:page standardController="Account" extensions="AccountDesignationHistoryExtension">
    <apex:pageBlock >
        <apex:pageBlockTable value="{!AccountDesignationHistory}" var="a">
            <apex:column value="{!a.cv__Opportunity__c}" headerValue="Number of Donations" />
            <apex:column value="{!a.Designation_Name__c}" headerValue="Designation Name" />
            <apex:column value="{!a.cv__Amount__c}" headerValue="Total Designated Amount" />
            <apex:column value="{!a.Close_Date__c}" headerValue="Most Recent Donation" />
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

 

I'm brand new to Apex and I'm having some trouble displaying aggregate results in a visualforce page. The extension isn't throwing any errors but the visualforce says "Error: Invalid field cv__Opportunity__c for SObject AggregateResult".

 

The way I read this is, either I'm not calling the fields properly in the visualforce page, or I'm not presenting the aggregate properly in the extension. Any help is of course greatly appreciated!

 

Here's the extension:

public class AccountDesignationHistoryExtension {
    
    Account CurrentAccount = null;
    List<AggregateResult> AccountDesignationHistory = null;
    
    public AccountDesignationHistoryExtension(ApexPages.StandardController controller) {
        CurrentAccount = (Account)controller.getRecord();
        AccountDesignationHistory = [SELECT COUNT(cv__Opportunity__c), Designation_Name__c, SUM(cv__Amount__c), MAX(Close_Date__c)
        From cv__Donation_Designation_Relationship__c
        WHERE cv__Opportunity__r.AccountId = :CurrentAccount.Id
        AND cv__Opportunity__r.StageName = 'Received'
        AND cv__Opportunity__r.cv__Posted__c = False
        GROUP BY Designation_Name__c];
    }
    
    public List<AggregateResult> getAccountDesignationHistory() { return AccountDesignationHistory; }
    
}

Here's the visualforce:

<apex:page standardController="Account" extensions="AccountDesignationHistoryExtension">
    <apex:pageBlock >
        <apex:pageBlockTable value="{!AccountDesignationHistory}" var="a">
            <apex:column value="{!a.cv__Opportunity__c}" headerValue="Number of Donations" />
            <apex:column value="{!a.Designation_Name__c}" headerValue="Designation Name" />
            <apex:column value="{!a.cv__Amount__c}" headerValue="Total Designated Amount" />
            <apex:column value="{!a.Close_Date__c}" headerValue="Most Recent Donation" />
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

 

Hello,

 

I am a new admin to SF and looking for some quick help if possible.  Just started to dive in to VR's in SF.  Trying to create a rule that prevents saving opportunity unless another drop down field is changed to a different stage.

 

Logic goes something like this: 

 

If ISPICVAL StageName "Order Closed" is selected, then the ISPICVAL CSSR_Status_c "Entered in SP" needs to be selected before allowing to save the Opportunity.

 

Thank You in advance!