0

I want to enter in the fields the new variables of the class "NewAddrees" extension I know my syntax is wrong but I do not know how to solve it

<apex:page standardController="Account" extensions="NewAddress">
    <apex:form >
    <apex:pageBlock title="Nombre de la cuenta: {!Account.Name}">
        <apex:pageBlockSection title="Direccion de Facturacion" columns="1">
            <apex:inputField value="{!Account.BillingStreet}" tabOrderHint="1"/>
            <apex:inputField value="{!Account.BillingCity}" tabOrderHint="2"/>
            <apex:inputField value="{!Account.BillingState}" tabOrderHint="3"/>
            <apex:inputField value="{!Account.BillingPostalCode}" tabOrderHint="4"/>
        </apex:pageBlockSection>


     <apex:pageBlockSection title="Direccion de Envio" columns="1">
            <apex:inputField value="{!Account.ShippingStreet}" tabOrderHint="1"/>
            <apex:inputField value="{!Account.ShippingCity}" tabOrderHint="2"/>
            <apex:inputField value="{!Account.ShippingState}" tabOrderHint="3"/>
            <apex:inputField value="{!Account.ShippingPostalCode}" tabOrderHint="4"/>

      </apex:pageBlockSection>



    <apex:pageBlockSection title="new Address" columns="1">
            <apex:inputField value="{!Account.FiscalStreet}" tabOrderHint="1"/>
            <apex:inputField value="{!Account.FiscalCity}" tabOrderHint="2"/>
            <apex:inputField value="{!Account.FiscalState}" tabOrderHint="3"/>
            <apex:inputField value="{!Account.FiscalPostalCode}" tabOrderHint="4"/>

      </apex:pageBlockSection>

  </apex:pageBlock>
    </apex:form>
</apex:page>




 public class NewAddress {
        private final Account account;

        public NewAddress(ApexPages.StandardController controller) {
            account = (account)controller.getRecord();
        }

        public String FiscalStreet { get; set; }
        public String FiscalCity { get; set; }
        public String FiscalState{ get; set; }
        public String FiscalPostalCode { get; set; }
    }

1 Answer 1

0

You can directly refer the attributes of your NewAddress class without appending Account to it. Only change would be that you cannot make use of <apex:inputField> as the variables declared in your extension class are not an sObject's field, instead you can use <apex:inputText> to capture input from users.

This is how it should be refered

<apex:pageBlockSection title="new Address" columns="1">
    <apex:inputText value="{!FiscalStreet}" tabindex="1"/>
    <apex:inputText value="{!FiscalCity}" tabindex="2"/>
    <apex:inputText value="{!FiscalState}" tabindex="3"/>
    <apex:inputText value="{!FiscalPostalCode}" tabindex="4"/>
</apex:pageBlockSection>

You can get help on this topic at this and this link

8
  • error console " Error: Atributo taborderhint no compatible en <apex:inputText>" with your code :( Commented Mar 5, 2019 at 8:44
  • You can use tabindex instead of taborderhint for inputText as there is no attribute called as taborderhint for inputText. Updated the answer. Commented Mar 5, 2019 at 8:52
  • thank you but now all property are unknow error console example... " Error: Property 'AccountStandardController.FiscalStreet' unknow" Commented Mar 5, 2019 at 8:57
  • I can solve, this was error syntax. Commented Mar 5, 2019 at 9:03
  • That's great !! Commented Mar 5, 2019 at 9:04

You must log in to answer this question.