Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7932027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:53:27+00:00 2026-06-03T20:53:27+00:00

I have created a custom object Assure__c and a custom apex class insEnfant like

  • 0

I have created a custom object “Assure__c” and a custom apex class “insEnfant” like this :

<apex:page standardController="Assure__c" extensions="insEnfant"  standardStylesheets="true">
    <apex:sectionHeader title="Ajouter un assuré"
        subtitle="{!$User.FirstName}" help="/help/doc/user_ed.jsp?loc=help"></apex:sectionHeader>
    <apex:form >
        <apex:pageBlock title="Nouveau assuré" id="thePageBlock" mode="edit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Enregistrer"></apex:commandButton>
                <apex:commandButton action="{!cancel}" value="   Annuler   "></apex:commandButton>
            </apex:pageBlockButtons>

            <apex:pageBlockSection title="Liste des enfants" columns="1"
                rendered="{!IF(Assure__c.Nombre_enfants__c > 0, true, false)}">


            <apex:pageBlockTable value="{!accts}" var="a" id="table">
                <apex:facet name="footer">
                    <apex:commandLink value="Ajouter" action="{!addRow}" rerender="table,error"/>
                </apex:facet>

                <apex:column headerValue="Nom">
                    <apex:inputHidden value="{!Assure__c.Name}" id="theHiddenInput"/>
                </apex:column>
                <apex:column headerValue="Nom">
                    <apex:inputField value="{!a.Name}"/>
                </apex:column>
                <apex:column headerValue="Prénom">
                    <apex:inputField value="{!a.Prenom__c}"/>
                </apex:column> 
                                <apex:column headerValue="Né le">
                    <apex:inputField value="{!a.Date_de_naissance__c}"/>
                </apex:column>   
                                <apex:column headerValue="Lieu de naissance">
                    <apex:inputField value="{!a.Lieu_de_naissance__c}"/>
                </apex:column>   
                                <apex:column headerValue="Situation">
                    <apex:inputField value="{!a.Situation__c }"/>
                </apex:column>                          
            </apex:pageBlockTable>

            </apex:pageBlockSection>

            </apex:pageblock>
    </apex:form>
</apex:page>


public class insEnfant{

    public List<Enfants__c> accts {get; set;}

    public insEnfant(){
        accts = new List<Enfants__c>();
        accts.add(new Enfants__c());
    }

    public void addrow(){
        accts.add(new Enfants__c());
    }

    public PageReference save(){
        insert accts;
        PageReference home = new PageReference('/home/home.jsp');
        home.setRedirect(true);
        return home;
    }
}

But when I tried to save it I obtain this error:

Error: Unknown constructor 'insEnfant.insEnfant(ApexPages.StandardController controller)'
Create Apex method 'insEnfant.insEnfant(ApexPages.StandardController controller)'

As I am new to salesforce.com, can anyone please give me the code for this??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:53:30+00:00Added an answer on June 3, 2026 at 8:53 pm

    Take a look at http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_extension.htm which explains that a controller extension needs to have a constructor that takes a StandardController as argument. (You’ve provided a constructor that takes no arguments.) There’s some sample code on that page that you may find helpful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a CalendarViewerPortlet custom object JS object. In this object, I am
I need to clone an object I have created (a custom class). Cloning it
I created a custom class for a custom object. I instantiate like so: Dim
I have a std::multimap where key is a custom class. Something like this: Class
I'm hoping someone can help on this one, I have created a custom object
I have created custom posts and I want one page in my site to
I have created custom result class to serialize json data to xml. I want
I am creating a page-based WPF application using MVVM. I have created a custom
I have created a Custom Validation Attribute: public sealed class DateAttribute : DataTypeAttribute {
I have created a custom even class which is pretty basic. But when calling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.