3

Anyone aware of why the initializeActivity method would not be called (when embedded in a layout)?

calling javascript throws a cross domain error. I really dont want to have to make a callout to make this work. Im trying to do a dml operation on initializing the controller.

Visualforce:

  <apex:page standardController="Contact" 
    extensions="ActivityExtension" action="initializeActivity">
  </apex:page>

Apex:

public ActivityExtension(ApexPages.StandardController stdController){
   id = stdController.getId();
   sObjectName = stdController.getRecord().getSObjectType().getDescribe().getName();
}
public PageReference initializeActivity(){
   read(sObjectName,id);
   return null;
}

1 Answer 1

6

Oi I feel like an idiot. Missing the required syntax in the action attribute:

this

<apex:page standardController="Contact" 
     extensions="ActivityExtension" action="initializeActivity">
</apex:page>

should be

<apex:page standardController="Contact" 
     extensions="ActivityExtension" action="{!initializeActivity}">
</apex:page>

nothing to see here...

=)

2
  • 1
    Mark the question as answered then :) Commented Aug 20, 2012 at 6:36
  • 1
    SE makes you wait two days before you can, well, you know.
    – ebt
    Commented Aug 20, 2012 at 6:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .