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
emuelasemuelas 

"Error: Field $Action.Event.New does not exist. "

Hi ,

 

I have a  requirement:
I need to Override 'Save' button on 'Event' to my VF page 'SendSMSToAttendees'.

 

Solution : I have created a VF page 'newEventpage' with the code as below, and override 'New' button of Event with the page.


<apex:page standardController="Event">
    <script>  
        window.top.location.replace("{!URLFOR($Action.Event.New, Event.id, [saveURL='/apex/SendSMSToAttendees', retURL='/apex/SendSMSToAttendees', cancelURL='/'+Event.id], true)}");
    </script>
</apex:page>

 

But I am not able to save the page. I am getting the error :


"Error: Field $Action.Event.New does not exist. Check spelling" .

 

I had a trial with Opportunities with the same logic and was working well.

 

 <apex:page standardController="Opportunity">
    <script>  
        window.top.location.replace("{!URLFOR($Action.Opportunity.New, opportunity.id, [saveURL='/apex/A', retURL='/apex/A', cancelURL='/'+opportunity.id], true)}");
    </script>
</apex:page>


I am not sure why it is not working for Event.

Can anyone help me in this matter?

 

Thanks
Ambily


  

Best Answer chosen by Admin (Salesforce Developers) 
emuelasemuelas

The issue is solved. i used NewEvent instead of New.

 

<apex:page standardController="Event">
    <script>  
        window.top.location.replace("{!URLFOR($Action.Even​t.NewEvent, Event.id, [saveURL='/apex/SendSMSToAttendees', retURL='/apex/SendSMSToAttendees', cancelURL='/'+Event.id], true)}");
    </script>
</apex:page> 

 

Thanks

All Answers

Navatar_DbSupNavatar_DbSup

Hi,


You can override the standard event create page with with Vf custom page by following the below steps

 

Setup-> Customize-> Activities-> Event Buttons and Links->click on Edit link present in front of New Event present in Standard Buttons and Links ->Click on Visualforce Page radio option and select your Vf page -> click on save button.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

emuelasemuelas

The issue is solved. i used NewEvent instead of New.

 

<apex:page standardController="Event">
    <script>  
        window.top.location.replace("{!URLFOR($Action.Even​t.NewEvent, Event.id, [saveURL='/apex/SendSMSToAttendees', retURL='/apex/SendSMSToAttendees', cancelURL='/'+Event.id], true)}");
    </script>
</apex:page> 

 

Thanks

This was selected as the best answer
chris_parxchris_parx

very helpful how you build your url with URLFOR, you spare me a controller :) Always looking for some documentation about this function.

 

Btw, you can even make better for the retURL (or cancel URL). Instead of using something static, you can get in javascript or with a salesforce function the current retURL when your page is called. here with the standard parameters function: "........., retURL=$CurrentPage.parameters.retURL, ....... "