You need to sign in to do that
Don't have an account?

How to display output text after click on saving button?
HI, I have a Auto number field ({!Product_Brief__c.Name}). It will generate number after saving the page. If i put this field in my page before saving it will break my page. So i want show this output text field after saving, but i could not use rerendering option. Coz I already used it for editing the page. If i combine with it, it will not work is there any way i can do this. Thanks.
Thanks
<apex:page standardController="Product_Brief__c" sidebar="true" showHeader="true" extensions="gibco"> <apex:form id="theForm"> <apex:pageBlock id="myPanel"> <apex:pageBlockSection collapsible="false" title="Section 1: Custom Media Information (Required)" id="thePageBlockSection"> <apex:outputText value="{!Product_Brief__c.Name}"></apex:outputText> <apex:inputField value="{!Product_Brief__c.Opportunity__r.Account.Name}" rendered="{!bEditMode}"/> <apex:outputField value="{!Product_Brief__c.Opportunity__r.Account.Name}" rendered="{!NOT(bEditMode)}"/> <apex:inputField value="{!Product_Brief__c.Customer_Number__c}" rendered="{!bEditMode}"/> <apex:outputField value="{!Product_Brief__c.Customer_Number__c}" rendered="{!NOT(bEditMode)}"/> <apex:inputField value="{!Product_Brief__c.Billing_Address__c}" rendered="{!bEditMode}"/> <apex:outputField value="{!Product_Brief__c.Billing_Address__c}" rendered="{!NOT(bEditMode)}"/> <apex:outputField value="{!Product_Brief__c.CreatedBy.Name}" rendered="{!NOT(bEditMode)}"/> <apex:inputField value="{!Product_Brief__c.Shipping_Address__c}" rendered="{!bEditMode}"/> <apex:outputField value="{!Product_Brief__c.Shipping_Address__c}" rendered="{!NOT(bEditMode)}"/></apex:pageBlockSection> <apex:pageblockButtons > <apex:commandButton action="{!doToggleEditMode}" value="Edit" reRender="myPanel" rendered="{!NOT(bEditMode)}"/> <apex:commandButton action="{!doSave}" value="Save" reRender="myPanel" rendered="{!bEditMode}"/> <apex:commandButton value="Save" action="{!save}" id="c2" rendered="{!NOT(bEditMode)}"/> <apex:commandButton value="Print" onclick="window.print();" rendered="{!NOT(bEditMode)}"/> <apex:commandButton value="Cancel" action="{!Cancel}" rendered="{!NOT(bEditMode)}"/> </apex:pageblockButtons> Extention public class gibco { public Product_Brief__c pb {get;set;} public User u {get;set;} private ApexPages.StandardController controller {get;set;} public boolean bUpdate {get;set;} public string loggedinUserId = UserInfo.getUserId(); public User u2 = [Select ContactId From User where Id =: '005R0000001Y6h4']; public String ctId{ get { // if (ctId==null){ // if (bUpdate){ ctId = u2.ContactId; // } return ctId; // } } set; } Contact ct = [SELECT AccountId FROM Contact WHERE id=:ctId]; public string getacct(){ Account acct = [SELECT Name FROM Account WHERE id=:ct.AccountId]; return acct.Name; return null; } Opportunity opp = [SELECT Id FROM Opportunity WHERE AccountId=:ct.AccountId LIMIT 1]; /* *************** Edit Sec. ************************ */ public Boolean bEditMode { get { if(bEditMode == null) { bEditmode = false; } return bEditMode; } set; } public PageReference doToggleEditMode() { bEditMode = !bEditMode; return null; } public PageReference doSave() { try { // Do your stuff to save your record controller.save(); doToggleEditMode(); } catch(Exception ex) { // Handle error } return null; }
Thanks
Try this, my bad i missed a bracket.
Thanks,
Fahad Akhtar
All Answers
Please see the code below, you can do something like this
<apex:outputPanel rendered={!IF(Product_Brief__c.id != null, true,false}>
<b><apex:outputText value="{!Product_Brief__c.Name}"></apex:outputText></b>
</apex:outputPanel>
Error: Syntax error. Extra ','
Try this, my bad i missed a bracket.
Thanks,
Fahad Akhtar