Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I'm trying to use the method @DanielBlackhall gave in this question: Loading a custom component into a Visualforce page dynamically

But unfortunately, this doesn't work anymore:

Type t = Type.forName('Component.c.MyCustomComponent');

always returns null.

share|improve this question
3  
I'm guessing the question is, how do you get it to work? –  Jesse Altman Feb 12 '13 at 16:58
    
@JesseAltman I think the question is how do you do Load a custom component into a Visualforce page dynamically now that the type.forname method doesn't work. –  Greg Grinberg Feb 12 '13 at 17:19

1 Answer 1

Unfortunately the Type.forName method has limitations and can't be used with Visualforce Components :-( I raised this exact Case to Salesforce and they advised me the same and that it was "out of scope".

Daniel Blackhall very kindly tried his original code again and confirmed we now can't get anything other than null. It can only invoke Primitives, sObjects, Collections and Apex types per the docs.

share|improve this answer
    
Yeah, I saw that on another forum I think. The thing is... I thought I actually had it working last week. Also, apparently, someone else did too. Just making sure I haven't missed anything stupid. –  thevoidwhichbinds Feb 12 '13 at 17:01
1  
What is the case number? I have had good luck getting things fixed when they are raised by multiple partners. –  Greg Grinberg Feb 12 '13 at 17:04
    
@grigriforce 08493365 - I'll send you a slab of chocolate if you can convince them! –  bigassforce Feb 12 '13 at 17:06
1  
@user31 I will definitely give it my best shot. Very annoying as I don't see an alternate method of doing this if type.forname doesn't work. –  Greg Grinberg Feb 12 '13 at 17:20
    
Beer too if they'll make ApexPages.Component a supported @RemoteAction return type as well ;-) –  bigassforce Feb 12 '13 at 17:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.