• Going South.ax738
  • NEWBIE
  • 125 Points
  • Member since 2010

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

From what I can tell from error messages, you are not allowed to use aggregate functions in subqueries.  Because of this limitation, I have rearranged my query so the aggregate functions are in the main query, but I am getting errors on the relationships.  Can someone help me sort this out?

 

I have renamed Opportunity as Dealer (plural: Dealers).

I have a Master-Detail relationship between Dealer (master) and custom sObject Car (plural is Cars), where there are many Car sObjects to one Dealer, and many Dealers to one Account.

I am trying to use the aggregate functions to sum up certain fields in the Car sObject for each Dealer.  For example, sum all the Car_Number_Field_1__c fields for all the Cars associated with one Dealer; then elsewhere I will roll up all these Dealer sums for each Account.

 

There are ways to do this without aggregate functions, but I am interested in getting this to work using aggregate functions.  The following select statement in the for statement will not compile.  I get errors in the subquery where the complier does not understand the relationship with Dealers__r and it doesn't understand Dealer__c.  Can someone help me figure out how to get this to compile?  Thanks.

 

I have created a Set of relevant Accounts in accountIDs

 

Map<Id, List<Decimal>> carTotals = new Map<Id, List<Decimal>>();

for (AggregateResult aggregateData : [select Dealer__c,

            (select Id, AccountID from Dealers__r where Id = Dealer__c),
            SUM(Car_Number_Field_1__c) Car1Total, SUM(Car_Number_Field_2__c) Car2Total,
            SUM(Car_Number_Field_3__c) Car3Total from Car__c
            where AccountID in :accountIds Group by Dealer__c])  {

     List<Decimal> carSums = new List<Decimal>{(Decimal)aggregateData.Get('Car1Total'),
          (Decimal)aggregateData.Get('Car2Total'), (Decimal)aggregateData.Get('Car3Total')};
     carTotals.put(AccountID, carSums);

}

  • July 01, 2010
  • Like
  • 0

Hello,

 

I wonder if anyone knows a way to modify (add fields to) the search results page that you get when you search for Accounts to merge [via Accounts >> Merge Accounts (in Tools section) >> Find Accounts]?

 

Thanks in advance

 

Demi

This trigger is on Quote and I am stuck on one part I am not able to use IsClosed() on quote status.

 

trigger CloseAllQuotes on Quote (after update) {

system.debug('Close All the Quotes on the Oppurtunity after one Quote is closed');

ID Oppid = Trigger.new[0].OpportunityId;
List <Quote> newQt = new List <Quote> ();

for(Quote Qt: newQT) {
    if((){ ----> I need to chk if previously this was not approved
    Qt = [select id,status,OpportunityId from Quote where OpportunityId=:Oppid]; 
    Qt.Status = 'Approved';
    Update Qt;
           
        }     
    }
}

In my application am using a custom object. When I try to fetch the count using "select count()..." it throws the exception - Too many query rows. Whereas Count aggregated function returns me the count 10226 and the same exception, but the custom object has only 660 records.

 

Is it a bug or am missing something?

I know it's possible to send emails with attachments and to hotlink images in templates using the img tag, but is there a way to reference an image in an email so that it is used in the email as, say, part of a signature?

 

The issue at hand is that it's bothersome when clients get the security warning bar appearing in their outlook telling them not to download images from the web; we'd like to avoid that but still use our company logo in our email signatures.

 

Any help would be appreciated, even if it's someone telling me that it cannot be done.

  • June 29, 2010
  • Like
  • 0

I've been seeing this more and more, the auto-complete / code assistance system for APEX in the Eclipse IDE often dosn't work. Even when I try to force if (CTRL+SPACE) i just see an empty list rather then the properties and methods of the object I'm working on.

 

Any ideas? Or is this a known issue?

Hi,

We would like to add a checkbox to our account page.  When that box is checked, the shipping address is automatically populated with billing address when the record is saved.  I thought I could create a simple workflow and field update, but I can't seem to find a way in the formula to have fields auto-populated.  Is there a way for this to be done?

  • August 23, 2010
  • Like
  • 0

Hello,
    I'm facing a issue with mobile application, I added Case Object to the Dataset and case comments as subset of Case to the mobile configuration. My profile is system admin, the problem is i'm able to see the case comments, but some of other people with different profile and role are not able to see case comments. I tried by changing their profile as admin and as same role i have, but even they are not able to see the case comments.
I tried by changing my profile and role to other user profile, still am able to see the comments for all the cases.

Please let me know what would be issue, this is very high priority. Please throw a light.

 

Regards,
Satheesh

Hi,

 

Is there a way to get data into a single extract when you are trying to hit multiple objects?  For example, the following query produces the exact number of lines in the exported CSV file; however, there is no data in the file.

 

Select o.AccountId, o.Account.Name, o.Id, o.Lead_Rep_Name__c, o.Name

from Opportunity o

I have a checkbox in Accounts that is called client. I want all child account client  = True when any one of those accounts has client = True.

 

For Instance:

 

Account A (parent account 1)

Account B (parent account 1)

Account C (parent account 1)

Account D(parent account 1)

 

If Client = True in Account A, I want Client to be set to True in Account B,C and D. Is this possible?

Hi,

 

Is there a possibility to create custom objects in a quick way or automatically?

background:
once a month, we have about 20 - 30 accounts for those we have to create a certain custom object. It is tedious to klick at an account, open in a new browser tab, click on new custom object and then on save.

-->>> Is there a way to automatically create a new custom object if one field in the account has a certain value?

Thank you
Sabine

Hi,

 

I uploaded a ton of data from Oracle to Salesforce with Pervasive Data Integrator but the proces halted with this error. I've been unable to find a solution for this. When I continue the mapping from the record it stopped, it can continue, so it's not an invalid data issue. The API call limit of the Salesforce account was not reached. The server didn't go down.

 

07/05/2010 18:43:31 1 0 O Global *** Execution Begin: [xmldb:ref:///xxx.tf.xml]
07/06/2010 00:18:09 4 8 O Global Update: error Server.userException (Error posting message: )
07/06/2010 00:18:09 4 25508 O Global Error writing to file or table
07/06/2010 00:18:09 4 25508 O Global Error writing to file or table
07/06/2010 00:18:09 4 8 O Global Update: error Server.userException (Error posting message: )
07/06/2010 00:18:09 1 0 O Global *** Execution End: [xmldb:ref:///xxx.tf.xml] (version 1.44) completed with errors
07/06/2010 00:18:09 1 0 O Global *** Execution Statistics: [xmldb:ref:///xxx.tf.xml] executed in 5 hours, 34 minutes, 37.441 seconds

 

 Any help is much appreciated.

 

 Thanks in advance,

 

Joris

  • July 06, 2010
  • Like
  • 0

I have a VF page, with two page blocks in it Both blocks contain pageBlockButtons ,
 containing one button in each..
There are few field in each block which are populated on button click ...

The Problem is when I click on one button .. The action of the button invoked and populate and when I click
on 2nd nothing happen.. And vice versa..

At time only one button's action is invoked and other remain idle..


Please tell me where im going wrong.!!
Any kinda help will b appreciated


Regards;
Aisha

From what I can tell from error messages, you are not allowed to use aggregate functions in subqueries.  Because of this limitation, I have rearranged my query so the aggregate functions are in the main query, but I am getting errors on the relationships.  Can someone help me sort this out?

 

I have renamed Opportunity as Dealer (plural: Dealers).

I have a Master-Detail relationship between Dealer (master) and custom sObject Car (plural is Cars), where there are many Car sObjects to one Dealer, and many Dealers to one Account.

I am trying to use the aggregate functions to sum up certain fields in the Car sObject for each Dealer.  For example, sum all the Car_Number_Field_1__c fields for all the Cars associated with one Dealer; then elsewhere I will roll up all these Dealer sums for each Account.

 

There are ways to do this without aggregate functions, but I am interested in getting this to work using aggregate functions.  The following select statement in the for statement will not compile.  I get errors in the subquery where the complier does not understand the relationship with Dealers__r and it doesn't understand Dealer__c.  Can someone help me figure out how to get this to compile?  Thanks.

 

I have created a Set of relevant Accounts in accountIDs

 

Map<Id, List<Decimal>> carTotals = new Map<Id, List<Decimal>>();

for (AggregateResult aggregateData : [select Dealer__c,

            (select Id, AccountID from Dealers__r where Id = Dealer__c),
            SUM(Car_Number_Field_1__c) Car1Total, SUM(Car_Number_Field_2__c) Car2Total,
            SUM(Car_Number_Field_3__c) Car3Total from Car__c
            where AccountID in :accountIds Group by Dealer__c])  {

     List<Decimal> carSums = new List<Decimal>{(Decimal)aggregateData.Get('Car1Total'),
          (Decimal)aggregateData.Get('Car2Total'), (Decimal)aggregateData.Get('Car3Total')};
     carTotals.put(AccountID, carSums);

}

  • July 01, 2010
  • Like
  • 0

Hello,

 

I wonder if anyone knows a way to modify (add fields to) the search results page that you get when you search for Accounts to merge [via Accounts >> Merge Accounts (in Tools section) >> Find Accounts]?

 

Thanks in advance

 

Demi

Hello..

 I'm trying to insert an entry in a custom object..


Code in apex is :

<apex:page controller="ProgramController">
    <apex:form >
        <apex:pageBlock title="Program Section">

            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" />
            </apex:pageBlockButtons>

 </apex:pageBlock>
    </apex:form>
</apex:page>

 

Controller -- ProgramController

 

public with sharing class ProgramController
{
    public void save()
    {    
        try
        {
            Program__c tempProgram = new Program__c(Payment__c= false,
                    ParentProgram__c='testProg');
            insert tempProgram ;

}  
        catch(System.Exception e)
        {
            ApexPages.addMessages(e);
           //throw e;
            // return null;
        }

    }
}

 

It's working fine for me .. now im trying to add some other controls like selectlist etc and tryin to format page accordingly.

The new apex page is like

 

Apex:

<!-- <apex:page controller="ProgramController">
<apex:page standardcontroller="Program__c" extensions="ProgramController">
-->
<apex:page controller="ProgramController">

    <h2>Program</h2>

    <apex:form >
        <apex:pageBlock title="Program Section">

            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" />
                <apex:commandButton value="Save & New" action="{!save}" />
                <apex:commandButton value="Close" rerender="out" status="status" />
            </apex:pageBlockButtons>

            <apex:pageBlockSection title="My Content Section" columns="2">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel >
                        <h1>Title:</h1>
                    </apex:outputLabel>
                    <apex:inputtext id="ProgramName" />
                </apex:pageBlockSectionItem>

                <apex:pageBlockSectionItem >
                    <apex:outputLabel >
                        <h1>Program Type:</h1>
                    </apex:outputLabel>
                    <apex:selectList value="{!types}" size="1" id="ProgType">
                        <apex:selectOptions value="{!type}" />
                    </apex:selectList>


                </apex:pageBlockSectionItem>

            </apex:pageBlockSection>

        </apex:pageBlock>
    </apex:form>
</apex:page>

 

and Controller is

 

ProgramController:

public with sharing class ProgramController
{
    Public Program__c auto{get; set;}
    String[] types= new String[]{};

    /*
    public ProgramController() {
    }

    public ProgramController(ApexPages.StandardController controller)
    {
    }

     public PageReference ProgramController()      
       {           
         return null;        
       }*/

    public List<SelectOption> getType()  
    {
        List<SelectOption> options = new List<SelectOption>();   
        options.add(new SelectOption('0.','Payment Program'));
        options.add(new SelectOption('1','Non-Payment Program'));
        return options;  
    }
    public String[] getTypes()
    {
        return types;
    }
    public void setTypes(String[] types)
    {
        this.types= types;        
    }

    public void save()
    {    
        try
        {
            Program__c tempProgram = new Program__c(Payment__c= false,
                    ParentProgram__c='testProg');
            insert tempProgram ;

    
        }  
        catch(System.Exception e)
        {
            ApexPages.addMessages(e);
            //throw e;
            // return null;
        }

    }
}

 

 

Now in this case, it's not allowing me to insert .. and i jus found that is because of the populating SelectLists and due to <apex:pageBlockSectionItem > tag in page ... if i exclude these two things .. all insertions are working fine. I don't have any idea where i'm going wrong..

 

Any kind of help will b appreciated..

Thnx!!

 

Hello.

 

I have an apex class on sandbox, with 100% unit test coverage, that I recently modified and am attempting to deploy to production via ANT. When I attempt to deploy this single class, though, I'm getting 0% unit test failures on EVERY one of my existing triggers on production. The existing triggers all have 100% coverage.

 

I tried deploying it via the "Deploy" option under "Setup" and that worked successfully. What would cause the ANT deployment to fail (after having worked for many months) but the Deploy option to succeed?

 

Thanks in advance.

 

-Greg

This trigger is on Quote and I am stuck on one part I am not able to use IsClosed() on quote status.

 

trigger CloseAllQuotes on Quote (after update) {

system.debug('Close All the Quotes on the Oppurtunity after one Quote is closed');

ID Oppid = Trigger.new[0].OpportunityId;
List <Quote> newQt = new List <Quote> ();

for(Quote Qt: newQT) {
    if((){ ----> I need to chk if previously this was not approved
    Qt = [select id,status,OpportunityId from Quote where OpportunityId=:Oppid]; 
    Qt.Status = 'Approved';
    Update Qt;
           
        }     
    }
}