+ Start a Discussion
sabinesabine 

create n new custom objects based on account selection

Hi,

I have a Visualforce page which displays some accounts after selecting a certain filter.
After selecting a filter and displaying the accounts, I want to generate a new custom object for each of the accounts displayed.
This should be done by clicking at the button as below {****THIS IS MISSING****} or if this is not possible by
clicking on one button in every row (how can I display one button per row?).

Is this possible?
I am new to Visualforce.

Note: I can not use Apex Classes due to Enterprise edition, no developer edition.

Hope anyone can give some advice.
thank you
Sabine

<apex:page standardController="Account" recordSetVar="accounts" tabStyle="Account" sidebar="true">
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />
            <apex:pageBlock >
                <apex:panelGrid columns="2">
                    <apex:outputLabel value="View:"/>
                    <apex:selectList value="{!filterId}" size="1">
                        <apex:actionSupport event="onchange" rerender="opp_table"/>
                        <apex:selectOptions value="{!listviewoptions}"/>
                    </apex:selectList>
                </apex:panelGrid>
            </apex:pageBlock>

            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Create Jubi" action="{****THIS IS MISSING****}"/>
               
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!accounts}" var="account" id="acc_table">
                <apex:column headerValue="Name" value="{!account.name}"/>
                <apex:column headerValue="Status aktuelles Jubi Review">
                    <apex:inputField value="{!account.Status_1_Jubilaeums_Review__c}"/>
                </apex:column>                
                <apex:column headerValue="Consultant">
                    <apex:inputField value="{!account.Consultant_1_Jubilaeums_Review__c}"/>
                </apex:column>                
                <apex:column headerValue="Jubis 2007" value="{!account.Jubis2007__c}"/>                
                <apex:column headerValue="Jubis 2008" value="{!account.Jubis2008__c}"/>                
                <apex:column headerValue="Jubis 2009" value="{!account.Jubis2009__c}"/>
                <apex:column headerValue="Jubis 2010" value="{!account.Jubis2010__c}"/>
               
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

MikeGinouMikeGinou

I'm confident enough to say that what you want is impossible without using classes. There are no standard controller actions to create records.

 

I must say I am be very surprised that you can create a VisualForce page, but not an Apex class. I hate to ask again, but you're sure you can't use Apex classes?

Jeremy.NottinghJeremy.Nottingh

Uh, yeah, if you have Enterprise Edition, you should be able to use Apex Classes. You can't develop right in your production org, so set up a sandbox organization, and do your development there, preferably through the Eclipse IDE.

 

If you can use a custom Apex Controller, your application is totally possible, and could be accomplished in multiple ways.

 

If you're just using a standard controller, you could set up a custom formula field that is a hyperlink to the edit page for a new instance of your custom object. It's my guess that this is not enough for you.

 

Jeremy