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
Ramiya KandeepanRamiya Kandeepan 

Redirecting to parent record after saving the child record

Hi,

Custom Object 1:  Project
Custom Object 2: Tasks
Custom Object 3: task names

I want to see when save a tasks(child) should return to parent record(Project).

Steps I am using:
-When clicking on 'create new task(custom button) will take to VF page
-Selecting some predifined field( task names) from VF page and click continue will redirect to Task object
- Saving this task record should redirected to parent record not child record -  How can I achieve this part?  How can I redirected to parent record? Can somebody help me?

Thanks

Ramu_SFDCRamu_SFDC
instantiate page reference variable and give the partial url as parent record id

eg : PageReference pageRef = new PageReference('partialURL'); 
                pageRef.setredirect(true);

change the PartialURL to '/' + 'recordID'.