You need to sign in to do that
Don't have an account?
bujji
Task 'Related To' list re order
Hi,
I am creating a task from the vf page, is it possible to re-order the list in 'Related To' field. Currently 'Account' is the default value. I want Opportunity as the default/first value in the list.
how to do it.
i tried Task mytask = new Task(what = 'Opportunity'); but i am getting error saying what is not writable field.
Thanks,
Bujji
Hi,
Your insert statement is wrong for inserting related to field in Task.
It shoulb be WhatID, you just mentioned what while inserting.
Try the following,
Opportunity opp = new Opportunity(name='Opp 1', stagename='Prospecting', closedate=Date.today()+10);
insert opp; //This opp id is going to be related to in task
Task mytask = new Task(whatid =opp.id);//here you mentioned wrongly
Don't forget to give Kudos and mark this answer as a Solution if this works out.
Thanks,
Bujji
Hi Bujji,
This is probably not possible if you are using the standard field in VF page. You can use a custom select list and populate all the possible values of "Related To" into this. WhatId is really matters, not What, while saving. How you have used VF page for creating new task? Is it by overriding the standard New button?
in the controller my code is Task mytask = new Task();
thanks,
Bujji