0

Normally with a standard controller you enter the ID in the URL to reproduce for example the apex:detail. Is this also possible by not entering the ID in the URL but trough and input-field?.

What I want to achieve is that an user can enter a field in the visual-force page trough an input-field where the apex detail gets reproduced and from there clone the record which also gets reproduced on the same page where the user can update the fields from the clone.

I cant seem to find any info on how to achieve this with a standard controller. If this is not possible I would have to reproduce the page myself and use a extension to pass the ID.

  • Below is the answer your looking for that ? – NITHESH K Sep 4 '17 at 5:31
2

Yes, You can do it in easy way, Just bind the account id with inputText " <apex:inputText value="{!Account.id}"> " and use same account id in apex:detail " <apex:detail inlineEdit="true" subject="{!Account.id}"> " when you click commandlink it just reRender the page. Just define inlineEdit="true" in apex:detail. Then you can get option for inline edit. see my below example.

<apex:page standardController="Account">
    <apex:pageBlock title="Hello {!$User.FirstName}!">
        You are displaying {!account.name} account.
    </apex:pageBlock>

    <apex:pageBlock title="Account" >
        <apex:form>           
            <apex:inputText  value="{!Account.id}"></apex:inputText>
                    <apex:commandLink value="click Here" >                    
                    </apex:commandLink>
        </apex:form>   
         <apex:detail inlineEdit="true" subject="{!Account.id}"  relatedList="false" title="false"/>
         </apex:pageBlock>
</apex:page>
  • You get more detail example in developer Guide. – NITHESH K Sep 4 '17 at 5:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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