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
PXForcePXForce 

Redirect URL

I am having an trouble with redirecting the user to the right URL (page) based on different actions. It seems that the returnURL is different for different actions. Heres my problem:

 

When I create new task on Contact /Account and then Save it  , it returns me to the Contact/Account page

Also 

If I click on Edit in the Edit/Del link under Open Activities on the Contact/Account page , it again returns me to the Contact/Account page.

BUT

When I click on a task in the Open Activity section and then click on edit and then save it , it returns me to the task page (in read mode) - THATS WHAT I WANT

 

What I want is to return to the task page (read mode) even when i create a new task or edit the task using the edit link.I am stuck with this and any help would be really appreciated. 

 

 

 

uptime_andrewuptime_andrew

I'm assuming you're using a VF page to save the record.  Have you tried a custom save command in the controller?

 

 

public PageReference save() { 
  upsert this.myTask;
  PageReference pg = new PageReference('/' + this.myTask.id);
  return pg;
}

 

 

PXForcePXForce

Thanks for the reply , but I am not using any visualforce page to save the record. Its the standard functionality on how tasks work but what I want to achieve is to go back to the task page irrespective of whether its a create or edit or edit through Del/Edit link under open activities. Is there any workaround to achieve this.

uptime_andrewuptime_andrew

Not that I'm aware of.  If you wish to achieve this, I suggest you create a Visualforce page copying the Task interface, and add the custom save function to control the redirect.

PXForcePXForce

Thanks again ,I did think about going down that road but it seems that all i would be doing is cloning the whole interface to override the save on create functionality / edit functionality. Is there an way way to clone an interface without coding the visualforce tags for every control on the page.