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
ThebannerkidThebannerkid 

New task creation page: Task owner Difficulties

I am having problems at current with an owner field in a new task creation page i am building. The organization I'm working for needs a very different form of functionality in their task creation which i am able to create. However i am running into problems when it comes to being able to change the task assignment when creating the task. Does any one know what type of input i would be needing to achieve this???
 
Cheers.
MerialMerial
Hi:

I have just a simple question, are you trying to change the ownerId, or the assign to field?
ThebannerkidThebannerkid

Sorry about the late reply but i was looking at the assigned to field. any help would be good.

 

Cheers

MerialMerial
Hi, don't worry about the delay.

Why just don't put your code here to see how it works.

i'll be waiting
MerialMerial
look at this i used in a vf page i made.

Code:
Code:

newTask2.add(new Task(Tarea_Origen__c =programas2.Id, Tipo__c=programas2.Tipo__c,IsReminderSet = true,ReminderDateTime = System.now()+1,WhatId=Programax.Id,Comentarios__c=programas2.Comentarios__c,OwnerId=programas2.Asignado__r.Id,Etapa_Programa__c = programax.Etapa_del_Programa__c,Subject=programax.Name+'-'+programas2.Asunto__c,Fecha_de_Inicio__c = Programax.Fecha_de_Grabaci_n__c - dia1,ActivityDate =Programax.Fecha_de_Grabaci_n__c - dia2));

insert newTask2;


 

 OwnerId it's the assign field in the task, and the __r field is the user id to be notified. It is very simple, did you check if the user you are logged in has access to the class an VF page??