• Integrator
  • NEWBIE
  • 0 Points
  • Member since 2011

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

If I create the very simple Visualforce page below, some unwanted datepicker elements appear on the page. Specifically, the dropdowns for month & day, the days of the week, and the "Today" link.

 

<apex:page showHeader="false" sidebar="false">
    <apex:form >
        <apex:commandLink value="Save" />
    </apex:form>
</apex:page>

 

If I use a commandButton instead, the datepicker elements disappear:

 

<apex:page showHeader="false" sidebar="false">
    <apex:form >
        <apex:commandButton value="Save" />
    </apex:form>
</apex:page>

 

Looking into the generated HTML, the first page is missing several script and CSS references that the second page has. I'm guessing this is the problem, but why is this happening?

 

My current workaround is to add a hidden commandButton to the form (see below), but I'd rather not rely on this. Am I doing something wrong in the first example? Are others able to reproduce this?

 

<apex:page showHeader="false" sidebar="false">
    <apex:form >
    	<apex:commandLink value="Save" />
        <apex:commandButton value="Save" style="display:none;" />
    </apex:form>
</apex:page>

 

I'd like to get the dates of the most recently completed activities for each of a set of contacts by using a single SOQL query.

I realize that I could fetch all completed activities for those contacts and iterate through them to find the most recent ones, but I'm wondering if it's possible to do this in a single query that only returns the data I need.

If I were writing SQL instead of SOQL, I would do something like the examples below. (I've omitted the where clauses for simplicity.)

select WhoId, Max(ActivityDate) 
from Task where ... Group By WhoId

 or less optimally,

select WhoId, 
   (select top 1 from ActivityDate from Task T2 where T1.Id = T2.Id order by ActivityDate desc)
from Task T1
where ...
Group By WhoId

 

Neither of these approaches seems to translate directly to SOQL. Is there an alternative?


If I create the very simple Visualforce page below, some unwanted datepicker elements appear on the page. Specifically, the dropdowns for month & day, the days of the week, and the "Today" link.

 

<apex:page showHeader="false" sidebar="false">
    <apex:form >
        <apex:commandLink value="Save" />
    </apex:form>
</apex:page>

 

If I use a commandButton instead, the datepicker elements disappear:

 

<apex:page showHeader="false" sidebar="false">
    <apex:form >
        <apex:commandButton value="Save" />
    </apex:form>
</apex:page>

 

Looking into the generated HTML, the first page is missing several script and CSS references that the second page has. I'm guessing this is the problem, but why is this happening?

 

My current workaround is to add a hidden commandButton to the form (see below), but I'd rather not rely on this. Am I doing something wrong in the first example? Are others able to reproduce this?

 

<apex:page showHeader="false" sidebar="false">
    <apex:form >
    	<apex:commandLink value="Save" />
        <apex:commandButton value="Save" style="display:none;" />
    </apex:form>
</apex:page>

 

I'd like to get the dates of the most recently completed activities for each of a set of contacts by using a single SOQL query.

I realize that I could fetch all completed activities for those contacts and iterate through them to find the most recent ones, but I'm wondering if it's possible to do this in a single query that only returns the data I need.

If I were writing SQL instead of SOQL, I would do something like the examples below. (I've omitted the where clauses for simplicity.)

select WhoId, Max(ActivityDate) 
from Task where ... Group By WhoId

 or less optimally,

select WhoId, 
   (select top 1 from ActivityDate from Task T2 where T1.Id = T2.Id order by ActivityDate desc)
from Task T1
where ...
Group By WhoId

 

Neither of these approaches seems to translate directly to SOQL. Is there an alternative?