• josh bowes
  • NEWBIE
  • 5 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hello,
I've got some Visualforce pages that use controllers which contain describe calls to get picklist values. The picklist values are being used to populate Google visualizaition API data.

Any time I add an <apex:form> tag to the Visualforce, the page returns:
System.SerializationException: Not Serializable: Schema.DescribeFieldResult

Here are the controller and visualforce. The first VF example works fine, the second returns the error above - the only difference is the form tag.

Controller:

public class myextensioncontroller {

    private final myobject__c myobject;
    public myextensioncontroller(ApexPages.StandardController stdController) {
  this.myobject = (myobject__c)stdController.getRecord();  
    }
 
 Schema.DescribeFieldResult p = myobject__c.mypicklist__c.getDescribe();
 List<Schema.PicklistEntry> stgvals = p.getPicklistValues();


 public List<myobject__c> getmyobjectdata(){
  return [select id, name from myobject__c]; 
 }

}

 
Visualforce that works:
<apex:page standardcontroller="myobject__c" extensions="myextensioncontroller">
   
   <apex:pageblock >
        <apex:pageblocktable value="{!myobjectdata}" var="myobj">
            <apex:column value="{!myobj.name}"/>
        </apex:pageblocktable>
    </apex:pageblock>  
    
</apex:page>

 Visualforce that returns serialization error:
<apex:page standardcontroller="myobject__c" extensions="myextensioncontroller">
   
   <apex:form></apex:form>

   <apex:pageblock >
        <apex:pageblocktable value="{!myobjectdata}" var="myobj">
            <apex:column value="{!myobj.name}"/>
        </apex:pageblocktable>
    </apex:pageblock>  
    
</apex:page>

 
This is causing me a lot of headaches because I can't use commandlink or commandbutton - does anyone see what the problem is? Is this a bug or am I doing something wrong?

I am looking for a way to make sure that contacts added as Event attendees do not receive a cancellation email when the Event that they were invited to is canceled. Is there a way to do this?

Hi,

since the upgrade to spring'12 many of my tests fail if I run them from theApex Test Execution page. But if I run them from the Apex Classes page (run all tests) they all pass fine!

 

It looks like the way the system processes simultanious tests in teh Test Execution Page has been changed. In the failing scripts I first delete all instances of a custom object and then insert a new instance, to be sure only that instance is in the database while testing. The error message I get since this week in many of my testclasses is:

 

System.DmlException: Delete failed. First exception on row 0 with id a03A0000001ItxxIAC; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []

 

Any tricks/ explanation or comment from salesforce?

thanks.

Hello,
I've got some Visualforce pages that use controllers which contain describe calls to get picklist values. The picklist values are being used to populate Google visualizaition API data.

Any time I add an <apex:form> tag to the Visualforce, the page returns:
System.SerializationException: Not Serializable: Schema.DescribeFieldResult

Here are the controller and visualforce. The first VF example works fine, the second returns the error above - the only difference is the form tag.

Controller:

public class myextensioncontroller {

    private final myobject__c myobject;
    public myextensioncontroller(ApexPages.StandardController stdController) {
  this.myobject = (myobject__c)stdController.getRecord();  
    }
 
 Schema.DescribeFieldResult p = myobject__c.mypicklist__c.getDescribe();
 List<Schema.PicklistEntry> stgvals = p.getPicklistValues();


 public List<myobject__c> getmyobjectdata(){
  return [select id, name from myobject__c]; 
 }

}

 
Visualforce that works:
<apex:page standardcontroller="myobject__c" extensions="myextensioncontroller">
   
   <apex:pageblock >
        <apex:pageblocktable value="{!myobjectdata}" var="myobj">
            <apex:column value="{!myobj.name}"/>
        </apex:pageblocktable>
    </apex:pageblock>  
    
</apex:page>

 Visualforce that returns serialization error:
<apex:page standardcontroller="myobject__c" extensions="myextensioncontroller">
   
   <apex:form></apex:form>

   <apex:pageblock >
        <apex:pageblocktable value="{!myobjectdata}" var="myobj">
            <apex:column value="{!myobj.name}"/>
        </apex:pageblocktable>
    </apex:pageblock>  
    
</apex:page>

 
This is causing me a lot of headaches because I can't use commandlink or commandbutton - does anyone see what the problem is? Is this a bug or am I doing something wrong?