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
ScriptMonkeyScriptMonkey 

Dynamic Component Problem

I posted a similiar issue in the VisualForce Forum, but realized this is more of an Apex issue.

 

I'm using the example for dynamic components that I found in the docs, since I need the functionality.  The concept seems perfect for my project, but the example doesn't even work.

 

I used this (exactly from the docs):

 

public Component.Apex.PageMessage getCheckDueDate() 
    { 
        Component.Apex.SectionHeader sectionHeader= new Component.Apex.SectionHeader(); 
        sectionHeader.title='This form was due on 03/06/2011!'; 
        date myDate = date.today(); 
        date dueDate = date.newInstance(2011, 3, 6); 

        boolean dueNow = myDate.isSameDay(dueDate); 

        if (!dueNow) 
        return sectionHeader; 
        else return null; 
    } 

and I get the error: 

Save error: Invalid type: Component.Apex.SectionHeader 

 

It's like it doesn't recognize the new object types.  (having the example code not work is VERY frustrating)

 

If anyone can help, I would greatly appreciate it.

Best Answer chosen by Admin (Salesforce Developers) 
Cory CowgillCory Cowgill

Dynamic Visualforce Components are in Pilot still I think.

 

Have you contacted Salesforce Support to enable Dynamic Components in your Org?

 

I believe you ahve to have SF Support enable this since its a Pilot feature and not GA (Generally Available) yet.

All Answers

Cory CowgillCory Cowgill

Dynamic Visualforce Components are in Pilot still I think.

 

Have you contacted Salesforce Support to enable Dynamic Components in your Org?

 

I believe you ahve to have SF Support enable this since its a Pilot feature and not GA (Generally Available) yet.

This was selected as the best answer
Cory CowgillCory Cowgill

Also make sure the Version on your Apex / VF is version 22 or 23.

ScriptMonkeyScriptMonkey

Waiting for them to enable it now, thank you!

 

Cory CowgillCory Cowgill

Great. If this resolved your problem please mark the solution as accepted.