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
Max_gMax_g 

Getting ownerid on a VF page

I am overriding the Log a Call button on activity history to a VF page.  I am not getting the ownerid to set the default.  What parameter can I access to generate this? 

 

Here is the code for my VF controller extension:

 

public withsharingclass LACCtrlExtension {

publicTask task {get; set;}

 

Public   string newname = Apexpages.currentpage().getparameters().get('id2');

   

public LACCtrlExtension(apexPages.StandardController controller){

           

this.task = (Task)controller.getRecord();

           

system.debug('Task Record is = ' + this.task);

         

           

this.task.subject = ApexPages.currentPage().getParameters().get('tsk5');

 task.Ownerid = newname;

                      

           

this.task.type = 'Call';

           

this.task.status = 'Completed';

           

this.task.activitydate = Date.today();

           

this.task.whoid = Null;

           

system.debug('Current Page = ' + ApexPAges.currentPage());

           

           

system.debug('WhatId = ' + task.whatId);

           

system.debug('Subject = ' + task.Subject);

           

system.debug('Assigned to = ' + task.OwnerId);

    }

 

}