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
VarunCVarunC 

Load Custom VF page after save of Event/Task

Can I Load my custom VF page just after Save of Task/Event? I mean that I create a new Task, and then when User presses Save, the record is saved and my Custom VF page is loaded and in that screen I can do my custom processing WITH the Record JUST Created.

Help needed ... thanks ...
MPIMPI
This sounds similar to creating a wizard. Maybe you could get some inspiration out of that code sample/tutorial?

http://wiki.apexdevnet.com/index.php/Visualforce
Down at the bottom.
VarunCVarunC
That lit up some bulbs .. but just to make sure that u understand my point here ... I Do NOT Want to Create my own Custom VF Page for Event/task forms, but What i want is user uses the same Default Event/Task forms, but on save I can present my custom page after the record is saved ... so will the Wizzard be helpfull in my case .. if so can you guide me more here ? ... thanks.
MPIMPI
Hmm...

The biggest problem I see here is that there is no way to insert the default edit page into a Visualforce Page and therefore no way that I can see to change the functionality of that edit page (including redirects).

What may work for you though is taking an approach from the other side. One possibility that I can see would work as follows:

1) Read only defaulted to "unchecked" field.
2) When you create a new event/task this field will be unchecked (because of the default)
3) You either override the View page for events/tasks or create a mini-page that gets inserted into the layout of the event/task which does the following only if that checkmark field is unchecked:

4a) Redirects to the more detailed edit page that you want which you can pass the id of the event/task through the "id" GET variable
OR
4b) Pops up your further edit page in a hidden div/new window/inline

5) This popup or hidden div contains a hidden field bound using value="{!checkmark_field}" to our checkmark field set to true. Thereby causing this window to pop up only once.


Just a warning though. By the looks of it, Salesforce has quite a bit of native custom stuff associated with Events and Tasks so I would be very careful when editing them. For example the event accept/decline page for people invited to the Event may bug out with this piece of code in it. Not sure.

Hope that helps.
VarunCVarunC
Ok going by this approach I will be providing the user with my Custom screen only when I save the record and then I edit/view that particular record. Any other way around you can think off? :) .. just for a thought, Can we add a custom Button of my Own on Edit screen of Event/Task ?
MPIMPI
I can't say what I'm suggesting is the best approach. I don't have nearly enough experience to be certain that's the best way, but it's all I could think of. =).

I don't believe you can make any edits to the Edit page (ironic?) of an object without overriding the link and completely recreating it from scratch using Visualforce. It's actually one of my main problems with Visualforce currently.
VarunCVarunC
well thanks anyways .. u have been very helpfull .. thanks.
MPIMPI
No problem. I really wish the developers would answer more questions on these forums. The lack of documentation and "best practice" examples makes it incredibly difficult to know when something you're doing is the right way or some wicked workaround that could be easily solved by some obscure way of using one of the standard methods.

Message Edited by YoriMPI on 12-18-2008 04:00 PM