+ Start a Discussion
shephalishephali 

Data Insertion

I have a VFpage v1 where i am asking user to put values in textbox but not saving data in object on button click rather i am generating random number on other VFpage v2 and want to insert those(v1) records on this V2's button click.how to do this???
Vishal_GuptaVishal_Gupta
Hi Shephali,

I am not exactly clear with your requirement but to achieve this you need to pass V1 values to page V2 and you can pass values as argument in URL. 

For ex : https://developer.salesforce.com/TestPage/?Name=value1&Address=Value2......

Thanks,
Vishal 
N.V.V.L.Vinay KumarN.V.V.L.Vinay Kumar
Hi Swarnkar,

Pleae post the pages and controller code.

Thanks,
N. Vinay.
shephalishephali
Hi Vishal and Vinay,
   Thanks for quick response.
My requirement is after successfull verification only i will save the inserted value.
1.In page V1 user putting the values.and redirected to page V2.
2. In page V2 user are asked to put the verification code and then only user's data will be stored(which is inserted in page V1).
shephalishephali
Hi friends,
   Is it like i need to cache or store the data temporarily somewhere and then store it after giving valide verifiction code.
how to do  this???
Vishal_GuptaVishal_Gupta
Hi Shephali,

I think you can implement wizard to achieve your requirment, please use the below link to understand it more :

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_wizard.htm

Please let me know if I can help you more.

Thanks,
Vishal
N.V.V.L.Vinay KumarN.V.V.L.Vinay Kumar
Hi Shepalli,

You can try below approaches.
Use same controller for both the Pages then the state will maintain.
As mentioned by Vishal you can also use a wizard approach.
Use same page but render the pages on button click.

Thanks & Regards,
N. Vinay Kumar.
 
shephalishephali
Hi Vinay and Vishal,
here is my apex class code.I want to send this "index" to another VF page on button click.plz help 
public class random
 {
    Integer index=0;  
    public Integer getindex()
   {
      double y = Math.random() ;  
      y = 999999 * y;
      index = math.round(y); 
    return index;
    }
}