You need to sign in to do that
Don't have an account?

Capturing What_ID on event in apex code
Hi,
I am trying to capture the account id from the url on clicking the new event button with the following statement:
String str;
str = ApexPages.CurrentPage().getParameters().get('what_id');
but the id isnt getting captured. Any idea why this is happening?
Thanks!
It is in a custom controller that is invoked by the button.
I am able to retrieve the event id with ApexPages.CurrentPage().getParameters().get('id') but could not get the 'what_id'
thanks
forgot to mention the button is overriden and it calls the controller
What is the URL that is generated by the button?
https://c.ap1.visual.force.com/apex/event?id=00U90000007wGgF&scontrolCaching=1
There is your problem. You'll need to add the id of the account that the button appears in as a parameter to this URL.