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
Abdullah Sikandar 15Abdullah Sikandar 15 

Create a Simple Visual force Page after creating a case,.

Hello Guys,

Thanks in Advance, i am new in Salesforce Development, can you guys please help me in creating a Visual force page.

Actually, i need to create a page after the user created their case.

It`s pretty simple but i don`t know the flow to make a page.

Once the user create their case then the it will come up with the "Thank You" page and say thanks for creating a case our team will be contact with you soon.

That`s it, just need to show a page with some Thank You quote on it.

Let me know the flow and how can i create a simple VF page.

Thanks Guys
Deepali KulshresthaDeepali Kulshrestha
Hi Abdullah,

I've gone through your requirement ,you can find below code helpful:

Visual Page:

<apex:page standardController="Case" extensions="CreateCase" >
    <apex:pageBlock id="pgblock">
        <apex:form id="frm">
        <apex:pageBlockSection title="Case Information" columns="1">
            
            
                <apex:inputField value="{!newCase.Origin}" label="Case Origin" />
                <apex:inputField value="{!newCase.Status}" label="Case Status" />
                <apex:inputField value="{!newCase.AccountId}" label="Case AccountId" />
                 <apex:commandButton value="Save" action="{!SaveCase}" />
        </apex:pageBlockSection>
              </apex:form>
    </apex:pageBlock>
</apex:page>

Apex Extension:

public class CreateCase
{
    public Case newCase{get;set;}
    public CreateCase(ApexPages.StandardController stdcontroller)
    {
        newCase=new Case();
    }
    public PageReference  SaveCase()
    {
        if(newCase!=null)
        {
            insert newCase;
            PageReference pr = new PageReference('your thank you page link');
            pr.setRedirect(true);
            return pr;            
        } 
        else
        {
            return null;
        }
    }
}


I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com