Save value to Session view Variable in axapta Enterprise portal

If you want to Save value to Session view Variable in axapta Enterprise portal webform to use on other webform you can try below code

declare variable and define macro variable.


  #define.TestType('TestSeq')  
 TestType _TestSeq;  
 //Then define loadviewstate method to load value to variable.  
 public void loadViewState()  
 {  
 super();  
 if (this.viewStateContains(#_TestSeq))  
 _TestSeq= this.viewStateItem(#_TestSeq);  
 }  
 //Then define saveviewstate method to save value to variable.  
 public void saveViewState()  
 {  
 ContainerClass cc;  
 ;  
 if (_TestSeq)  
 this.viewStateItem(#_TestSeq, _TestSeq);  
 super();  
 }   

Then you can store value to _TestSeq variable. Now you can use this variable value to running on other webform.