function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
<apex:page standardController="Account" extensions="BillingAndShippingAddress"> <apex:form> <apex:pageBlock title="Create Account" > <apex:pageMessages /> <apex:outputPanel id="Basics" > <apex:pageBlockSection title="Basic details" > <apex:inputField value="{!Account.name}" /> <apex:inputField value="{!Account.Phone}" /> <apex:inputField value="{!Account.Industry}" /> <apex:inputField value="{!Account.Annualrevenue}" /> </apex:pageBlockSection> </apex:outputPanel> <apex:outputPanel> <apex:pageBlockSection title="Billing Address" > <apex:inputField value="{!Account.BillingStreet}" /> <apex:inputField value="{!Account.BillingCity}" /> <apex:inputField value="{!Account.BillingState}" /> <apex:inputField value="{!Account.BillingCountry}" /> <apex:inputField value="{!Account.BillingPostalCode}" /> </apex:pageBlockSection> </apex:outputPanel> <apex:pageBlockSection id="Question"> <apex:outputLabel>Is Shipping Address same as Billing Address?</apex:outputLabel> <apex:inputCheckbox value="{!isBASameAsSA}"> <apex:actionSupport event="onclick" reRender="SA,Basics" action="{!copyAddress}" /> </apex:inputCheckbox> </apex:pageBlockSection> <apex:outputPanel> <apex:pageBlockSection title="Shipping Address" id="SA" > <apex:inputField value="{!Account.ShippingStreet}" /> <apex:inputField value="{!Account.ShippingCity}" /> <apex:inputField value="{!Account.ShippingState}" /> <apex:inputField value="{!Account.ShippingCountry}" /> <apex:inputField value="{!Account.ShippingPostalCode}" /> </apex:pageBlockSection> </apex:outputPanel> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}" /> <apex:commandButton value="Cancel" action="{!cancel}" /> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>
public class BillingAndShippingAddress { public boolean isBASameAsSA{ get; set;} public Account act{ get; set;} public BillingAndShippingAddress(ApexPages.StandardController controller) { isBASameAsSA=false; act=(Account)controller.getRecord(); } public pageReference copyAddress() { If(isBASameAsSA==true){ act.ShippingStreet=act.BillingStreet; act.ShippingCity=act.BillingCity; act.ShippingCountry=act.BillingCountry; act.ShippingState=act.BillingState; act.ShippingPostalCode=act.BillingPostalCode; } else{ act.ShippingStreet=''; act.ShippingCity=''; act.ShippingCountry=''; act.ShippingState=''; act.ShippingPostalCode=''; } return null; } }
can you explain briefly about your requirement what u need
trigger
process builder
or something else let me know complete
thank you
Avaneesh Singh
Show me your code where u are stuck ..Let me know
I will resolve it
Please refer the below link for your requirement.
https://developer.salesforce.com/forums/?id=906F0000000DCXv
Hope this link will help you to fix your issue. make it solved if its works for you.
Best Regards,
Rakesh Thota.