function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Transferring value to next page through controller

I want to build a form in which title of next page and name of record should increment by one. i dont know how to save the value in the controller because every time we direct to new vf page. controller value are getting null .

Example to explain situation:

Page1 :
some detail
Button1: Next          Button2: add another house

If you click on Next it redirects to new page and its value should be 1 which is not a problem
IF you click on add another house the next page title should be house 2 and name of record should be house2  and it direct to same page to create new record.

If he clicks again than it should go to house 3 . 
And if he click to next it redirect to another form which starts from 1. 

Can anyone help me how should i approch this ?            


Phillip SouthernPhillip Southern
Hi, so couple of suggestions:

1.) Instead of a visualforce page wizard, have you considered using Flow?  This sounds like a typical use case for Flow and would create much less code burden.

2.) If Flow does not work (and again, really stress checking it out), then you can take a Visualforce wizard approach as talked about here with examples:
hey phillip thanks for reply

I want to go with visualforce page because we want to add aditional feature later.
Can i store value in controller or something like that ? 
setRedirect(false) solved my problem