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
Aviator_07Aviator_07 

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!

bob_buzzardbob_buzzard
Where is this code appearing? The standard pages don't have controllers, so how are you associating this code with the button?
Aviator_07Aviator_07

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

Aviator_07Aviator_07

forgot to mention the button is overriden and it calls the controller

bob_buzzardbob_buzzard

What is the URL that is generated by the button?

bob_buzzardbob_buzzard

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.