• kreshocs
  • NEWBIE
  • 0 Points
  • Member since 2012

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

To take the example from the docs:

AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM Opportunity 
GROUP BY CampaignId];

Now try

Map<ID, AggregateResult> resultsMap = [SELECT CampaignId, AVG(Amount) 
 FROM Opportunity 
 GROUP BY CampaignId]; 

This won't work even though CampaignId is of type ID. To make it work, alias CampaignId with Id:

Map<ID, AggregateResult> resultsMap = [SELECT CampaignId Id, AVG(Amount) 
 FROM Opportunity 
 GROUP BY CampaignId]; 

Interestingly, the case here does matter. Aliasing with id or ID won't work.

 

This worked on March 28th 2012 (seriously, I swear it did! :-), but does not any more.

 

Please support my idea at https://sites.secure.force.com/success/ideaView?id=08730000000hmhOAAQ to reinstate this behavior. 

To take the example from the docs:

AggregateResult[] groupedResults = [SELECT CampaignId, AVG(Amount) FROM Opportunity 
GROUP BY CampaignId];

Now try

Map<ID, AggregateResult> resultsMap = [SELECT CampaignId, AVG(Amount) 
 FROM Opportunity 
 GROUP BY CampaignId]; 

This won't work even though CampaignId is of type ID. To make it work, alias CampaignId with Id:

Map<ID, AggregateResult> resultsMap = [SELECT CampaignId Id, AVG(Amount) 
 FROM Opportunity 
 GROUP BY CampaignId]; 

Interestingly, the case here does matter. Aliasing with id or ID won't work.

 

This worked on March 28th 2012 (seriously, I swear it did! :-), but does not any more.

 

Please support my idea at https://sites.secure.force.com/success/ideaView?id=08730000000hmhOAAQ to reinstate this behavior. 

Hi,

 

I have a pretty simple custom component that is in a managed package and deployed to an organization that has no namespace. In this case, Salesforce seem to be having an issue resolving the correct namespace. Here is the simplest way of reproducing the issue:

 

1, First create a custom page that will be the target of our button that is in our custom component:

 

<apex:page >
  <h1>Target Page</h1>
</apex:page>

 

 

2. Create a custom controller called TestController:

 

global with sharing class TestController
{

    public TestController()
    {

    }
    
    public PageReference goToNextPage()
    {
    
        return Page.test__TestNextPage__c;
    }
    
    static testMethod void runTestCases()
    {
        TestController t = new TestController();
        system.assertEquals(t.goToNextPage().getUrl(), Page.test__TestNextPage__c.getUrl());
    }   
}

 3. Now create a custom component that will use the above controller:

 

<apex:component controller="TestController" allowDML="true" access="global">
 
 <h1>Test componet</h1>
 <apex:form >
     <apex:pageBlock id="testBlock" title="Test Block" rendered="true">
     
         <apex:pageBlockButtons location="top">
            <apex:commandButton action="{!goToNextPage}" rendered="true" value="Go To Next Page" disabled="false" />
         </apex:pageBlockButtons>
     
     </apex:pageBlock>
 </apex:form>
</apex:component>

4. Now package this up as a managed package and deploy it into an ORG that has no namespace defined.

5. In the new ORG, create a new custom visualforce page that will use the packaged test component:

 

 

<apex:page >
  <h1>Test Page</h1>
 
  <test:TestComponent id="testComponent" rendered="true" />
</apex:page>

6. Now when you navigate to the page, and click on the "Go To Next Page" button you get the following error:

 

URL No Longer Exists

If you then add a namespace to the same ORG, the button starts working. Any ideas, suggestions?

 

Thanks!

 

 

 

 

I am making future calls from APEX code and need to know when the calls complete so I can do other processing. If I use the GUI of Salesforce I can go to the Setup area and under 'Monitoring', I can use the 'Apex Jobs' selection to see the job is processing and if it completed.

 

Reason being, my APEX code breaks the future calls up into batches.  I usually end up doing 3 future calls, but need to know all three have completed before I can continue with some DML operations.


How can I get the future call status information programatically within my code?

 

  • October 29, 2010
  • Like
  • 1