function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MG ConsultingMG Consulting 

Valid AssignTo Types?

Hi,

 

When I try to pass the following custom apex class to a custom component via the attribute's assignTo I get an internal server error (Error ID: 461678711-978 (887763395)). I'm pretty sure this has to do with trying to pass it an SObjectField.

 

I need to pass the component either a FieldDescribeResult or an SObjectField in order to avoid hitting governor limits with fields.getMap() calls.

 

Any ideas?

 

 

public class StandardQuestionObj {

public StandardQuestionObj(StandardQuestion__c sObj, SObjectField sObjField) {
this.SObj = sObj;
this.SObjField = sObjField;
}

public StandardQuestion__c SObj { get; set; }
public SObjectField SObjField { get; set; }
}

 

<apex:component id="standardQuestionComponent" controller="StandardQuestionController">
<apex:attribute name="standardQuestionObj" description="The Standard Question Object." type="StandardQuestionObj" required="true" assignTo="{!StdQuestionObj}"/>

...

</apex:component>

 

 

Thanks a lot,

Mike

 

MG ConsultingMG Consulting

Turns out that it doesn't have anything to do with trying to pass an SObjectField as I replaced it with a String and I still receive an Internal Server Error.

 

The documentation says that you can pass "custom Apex types (classes)" so I have no idea what is going on here.

 

I logged Case02724595 for this on Friday afternoon.

 

 

public class StandardQuestionObj {

public StandardQuestionObj(StandardQuestion__c sObj, String dispType) {
this.SObj = sObj;
this.DispType = dispType;
}

public StandardQuestion__c SObj { get; set; }
public String DispType { get; set; }
}

 

Thanks a lot,

Mike