class - Return.Page Account ID -


how can add return.page syntax account id.
code below doesn't work.

public class baw3_class {  private id accid {get; set;} public baw3_class(apexpages.standardcontroller stdcontroller) {      accid = stdcontroller.getrecord().id; }    public decimal testvalue { get; set; }  public pagereference nextpage () {          if(testvalue == null) {         apexpages.addmessage(new apexpages.message(apexpages.severity.error, 'required value'));         return null;     }              testvalue += 500;      return page.baw3?id=accid;     } 

it possible add id string page.baw3?id=.......

thanks, sascha

edit 18.03.2015

unfortunately doesn't work.

below post whole code again. hope find problem. page value. need information account.

visualforce: page show result

<apex:page controller="bestandsauswertung3_class" showheader="false"     sidebar="false">    {!testvalue}   <br/>   <apex:datatable value="{!acclist}" var="record">   {!record.name}   </apex:datatable>  </apex:page> 


visualforce: prepage add value

<apex:page controller="bestandsauswertung3_class" showheader="false" sidebar="false">   <apex:sectionheader title="baw 1" subtitle="next page test" />   <apex:form >       <apex:pagemessages id="messages" />       <apex:pageblock >                      <apex:commandbutton value="wert für sv-ersparnis" action="{!nextpage}" />           <apex:inputtext value="{!testvalue}" />       </apex:pageblock>   </apex:form> </apex:page> 


class

public class bestandsauswertung3_class {  private id accid {get; set;}     public list<account> acclist {get; set;} public bestandsauswertung3_class() {      accid = apexpages.currentpage().getparameters().get('id');     acclist = [select name, numberofemployees account unternehmens_id_long__c = :accid];       anteilm = 0;     anteilf = 0;      getezren();     }  public integer anteilm {get; set;} public integer anteilf {get; set;}  public decimal testvalue { get; set; }  public pagereference nextpage () {          if(testvalue == null) {     apexpages.addmessage(new apexpages.message(apexpages.severity.error, 'required value'));         return null;     }             testvalue += 500;    return new pagereference('/apex/bestandsauswertung3?id='+accid);    }    public void getezren() {  list<einzelrisiko__c> ezrlist = [select geschlecht__c einzelrisiko__c unternehmens_id_long__c = :accid];      (einzelrisiko__c ezr : ezrlist) {        if(ezr.geschlecht__c == 'w') { anteilf++; }      if(ezr.geschlecht__c == 'm') { anteilm++; }    } }  } 

assuming baw3 vf page..

do following:

return new pagereference('/apex/baw3?id='+accid); 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -