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
Simran SuriSimran Suri 

Create case through VF1 page and Display Case Number on VF2 page?

Hi,
I have created a custom Case form on VF1 page with a Submit button and a custom Case controller class. When the user clicks on Submit button, a case gets created in Salesforce and navigates to another VF2 page for case acknowledgement stating 'Thank you for submission..'. Now, I, also want to display the Case number generated on VF2 page as soon as the user submits the case. Any ideas??
rajat Maheshwari 6rajat Maheshwari 6

Hi Simran,

Please take reference from this 2nd vfPage. You just need to add <apex:outputText> tag in VF2 page and both vfPage will share 1 controller

<apex:page Controller="leadGenerationHandler">
 <!-- SubTitle Section --> <apex:sectionHeader subtitle="Thank you for submit Information"/> 
<apex:form > <!-- displays all message generated by the controller logic --> 
<apex:pageMessages /> 
<apex:pageBlock title="Contact Info"> <!-- Form attribute section -->
 <apex:pageBlockSection showHeader="false" columns="1">
 <apex:outputfield value="{!lead_Recd.Name}"/> 
</apex:pageblocksection> 
</apex:pageBlock> 
</apex:form> 
​</apex:page>
 

Please let me know, the results :)

Thanks
Rajat Maheshwari
rajatzmaheshwari@gmail.com

AjazAjaz
Hi Simran,

While redirecting the page from VF1 to VF2 through controller 1, pass the Case number as parameter to the VF2 page.
In VF2's controller, assign a value to any variable that can be used on VF2.

Let me know the feedback.

Regards,
Zaja.

 
Simran SuriSimran Suri
Hi Rajat & Ajaz, Thank you for your inputs. But, I am using only one controller class and two VF pages, where VF1 is the Case form and VF2 contains just acknowledgement statement and most of my code lies in the pagereference method for Submit button.
@Rajat: outputText doesn't work
@Ajaz @Rajat: Could you give me some idea if I can fetch the case number in page reference method in my Apex controller class and access it on VF2 page? Thanks !
rajat Maheshwari 6rajat Maheshwari 6

Hi Simran,

Please provide me the two vfPage and 1 controller which you have created to my mail Id and over here also I will look over the same.

Thanks
Rajat Maheshwari
rajatzmaheshwari@gmail.com