Questions tagged [tasks]

Task is an activity record, one that has a date but no time associated.

Filter by
Sorted by
Tagged with
16
votes
2answers
1k views

How to use an Apex Email Service to store emails on a record EXACTLY as Salesforce does?

I have used the Lightning Experience UI to send an Email from a Record Homepage via Activity-Tab. This looks like this (bottom-right!): Now I want (vice versa) to store an incoming email received by ...
11
votes
1answer
759 views

Can a task that is generated from a workflow set off a time trigger to fire another task?

I have a task that generates when a record is created off a Custom OBject. I tried to create another workflow on the Task object that would fire when that task is generated, but it did not work. The ...
9
votes
1answer
3k views

Can you create a Lookup to a Task?

I do not see Task/Activity/Event as an option for a Lookup on my custom Lookup on the Case object. I know Tasks are treated differently than other object but I cannot find any documentation stating ...
8
votes
1answer
2k views

Can multiple users be notified for a single task

Is it possible to create a single task that notifies multiple users (3 - 4) to prompt them so one of them then actions it? I don't want to create multiple tasks, just one task for multiple users. ...
8
votes
2answers
2k views

What is the difference between {!URLFOR($Action.Activity.NewTask)} and {!URLFOR($Action.Task.NewTask)}?

When you try to create a custom button for a Task, if you choose "$Action" in the "Select field type", you have two options to define that button: $Action.Activity.NewTask - This will take you to a ...
7
votes
2answers
316 views

Formula field is not Working as expected

Hi friends i create a formula field to know the created task is for contact or opportunity or lead.So i tried to created a formula field Based on whatId & whoId. But it throws syntax error.can ...
7
votes
1answer
4k views

Is it possible to add an attachment to an existing Task or Event?

Using the standard Salesforce interface for Tasks (Page Layout), there is a related list for Attachments. However, there's no button to add a new Attachment to an existing Task, and when I edit the ...
7
votes
1answer
1k views

Unit Tests: create completed tasks for ActivityHistory?

In unit tests, is there a specific way of creating completed tasks so that they appear immediately in the ActivityHistory read-only object? (I have batch Apex that pulls data from ActivityHistory, ...
7
votes
2answers
535 views

Cannot query UserRecordAccess for Tasks

I am running my query using the Rest API, but I have reproduced the issue in Workbench as well. The below query works for Account, Opportunity, and Contact, but fails for Task: SELECT ...
7
votes
1answer
2k views

Why are phone calls “Tasks” and not “Events”?

Is there a reason that the generic Salesforce model makes phone calls "Tasks" and not "Events"? It seems like calls have start times and end times just like Events. What advantage does not having ...
6
votes
3answers
855 views

Trigger not updating field in Test Class

I'm pretty new to Apex and I'm trying to write a trigger that will update my LeadStatus field from 'Open-Not Contacted' to 'Open- Working' upon completion of sent email (logged in Activity History). ...
6
votes
4answers
8k views

Which field represents the “Send Notification Email” checkbox present on the Task page layout?

Suppose i want to upload 1000 tasks via the data loader and i want that the owner of those tasks should receive a notification mail about the tasks assigned to them. How can i achieve this? Note: I ...
6
votes
1answer
312 views

Email in salesforce

I have been trying to figure out the REST API for email synchronization with Salesforce, and realized that there is no formal Email object in the API sobjects. Digging deeper, i found out that even ...
6
votes
2answers
1k views

Why are the results returned using a subquery different than when querying Tasks directly?

I am running the code below in a Task trigger. The subquery on Account returns 0 rows, but the direct Task query returns 1 row; there should be 1 row. Can someone explain why this could be happening....
6
votes
1answer
13k views

Enabling Editing/Deleting others' Tasks without “Modify All”

Use Case My users are primarily Service users. They all have Read/Write access (through sharing rules) on all Cases, Contacts and Accounts that they deal with. They collaborate on data grooming - ...
5
votes
1answer
2k views

Creating a closed task in APEX

I'm trying to create a "Log a Call" task with apex. I need this task to be marked as Closed but when I try to set the IsClosed field to true I'm getting the "Field not writable" error. How can I work ...
5
votes
1answer
730 views

Query and Follow Owner Relationship on Tasks

I actually can't believe I've not come across this before now, but is there a way of following on the owner relationship on a Task to get some other field on the User object? For an example, say on ...
5
votes
1answer
924 views

Are there limitations on querying Tasks

I am trying to bulk re-parent activities from one object to a new object. When I use the following SOQL query I get no results even though I know the record exists: SELECT Id,WhatId FROM Task ...
5
votes
1answer
264 views

How to set create user field using apex?

I have an email service handler that parses text and creates a new task for the user (based on the 'from' email). This is similar to the Email2Salesforce feature. I'm having trouble setting the ...
5
votes
2answers
1k views

how do we query for the Last completed task and Next open task for an account in SOQL

I am trying to get the Last completed task and next open task for a set of accountids. I can get the Last completed by using the following query SELECT id, (select activitydate from tasks WHERE ...
5
votes
2answers
2k views

Creating a Task and staying on the detail page for that task (not navigating elsewhere)

When you click the New Task or Log A Call button from the Open Activities or Activity History related list on e.g. an Opportunity, you're taken to the regular https://<instance>.salesforce.com/...
5
votes
1answer
318 views

Inserting a task from a Force.com Site

I have a Force.com Site with a controller inserting a new Task. I noticed that I receive no error on the page, but the Task is not created. When I access to the same page internally (from https://.../...
5
votes
1answer
152 views

What is Data Type of ActivityDate (Due Date) field on Task Object?

On the Task's field setup page, the ActivityDate is described as Date/Time but when I try to assign a DateTime variable to it, then I receive this error t.ActivityDate = DateTime.now() //this line of ...
5
votes
0answers
1k views

Display Tasks in Calendar in Lightning Experience for all Users

I would like to see Tasks in my Calendar in Lightning. According to this Idea, this is delivered in Lightning Experience. I can see that I can do it using the Create a Calendar from Anything feature, ...
4
votes
5answers
3k views

Activities on Leads, Opportunities, and Accounts SOQL

I'm trying to get SOQL's for Activities (workbench was no help). I'm looking at the three prebuilt reports in Salesforce: Activities on Leads, Activities on Accounts, and Activities on ...
4
votes
1answer
6k views

Create Chatter Post and @mention User in Trigger

I have a trigger that creates a chatter post after insert or after update for Tasks. However, I also want to @mention the created by user for the task. How Can I add this? Thanks trigger ...
4
votes
1answer
7k views

Trigger on Task/Activity - can you access Activity?

I need to have a trigger that updates a date on the contact based on whether a task was created with two specific dispositions (Call_Disposition__c is a custom field on the Activity). Since the field ...
4
votes
2answers
123 views

List has no rows for assignment: Trigger that shouldn't fire when there are no rows

sorry for the vague title. Essentially, I have a trigger I've created to change ownership of an opportunity based on some business rules our company has. When a sales user places a call to a ...
4
votes
2answers
800 views

Query LeadSource from Task

I am trying to write a SOQL query that queries from Task the field LeadSource. In a report the name of the field that displays LeadSource is Contact/Lead. I have been trying different variations like ...
4
votes
1answer
877 views

How can I “close” a Task from the REST API/Apex

Since all picklist values for the Status field on Tasks are configurable I don't think I can simply set the Status to "Completed" as that picklist value could have been deleted/renamed. I tried ...
4
votes
1answer
1k views

How can I update Tasks via API in an org with 'Shared Activities' enabled?

“I've adapted Scott Hammeter's dandy code (http://sfdc.arrowpointe.com/2009/10/06/associate-email-to-salesforce-task-to-opportunity/) so I can relate the tasks created by inbound Email-to-Salesforce ...
4
votes
1answer
1k views

How to create a Task with Due Date using URLFOR

I want to code a button on a custom object to generate a task with some precompleted fields. I can do it like this: /00T/e?what_id={!My_Object__c.Id}&tsk5="This is a Task"&tsk4={!TODAY()+21}&...
4
votes
1answer
435 views

Create task-salesforce

Guys i hope i would get some help here. I am trying to automatically create tasks. Creating task is very simple as I know. But the scenario is different here. I have an account where I'm doing some ...
4
votes
1answer
2k views

How can I filter activities by record type?

Issue How can I filter the ActivityHistories sub-query by record type? When I use record type in the query it's saying the field isn't valid. Background I'm doing a custom last activity date for a ...
4
votes
1answer
1k views

Send email notification when task is created

Task t = new Task(); t.WhatId = 'custom object Id'; t.OwnerId = 'userid'; t.Subject = 'Test'; t.Priority = 'High'; t.Status = 'Test Status'; t.Description = 'Test Note.Description__c'; Database....
4
votes
2answers
612 views

Blank emails sent when Visualforce email template called from workflow

enter code hereI have created visualforce email template for Task Object. Email pops up to the respective user Id when sent through 'Send test and verify merge fields' with content specified in ...
4
votes
1answer
756 views

Not able to edit Task 'Assigned To' field when displayed as table in VF page

I have created a Record Type for Task called 'Follow on Task'. In a VF page I am displaying all 'Follow on Task' records in a apex:pageBlockTable with mode='inlineEdit' <apex:page ...
4
votes
2answers
3k views

how a user can assign tasks to another user en mass

We assign tasks en mass to our sales reps. However when the rep is on annual leave they need to be able to assign their tasks en mass to colleagues. How can they do this in Salesforce?
3
votes
1answer
2k views

Apex - Task.What.Type

Need a little help. I can't figure out the correct syntax to utilize Task What.Type in my trigger. Can someone tell me what I am doing wrong? trigger ININRelatedToFix on Task (after Insert, after ...
3
votes
2answers
2k views

How to get around this - “Error: You cannot reassign a recurring task occurrence.”?

Any idea on how to get around this error: You cannot reassign a recurring task occurrence.
3
votes
2answers
452 views

Showing alert for a user assigned a task

I'm looking for a way to show an alert / a notification / a popup or similar for the user which has been assigned a task? It should be nearly real time, that is if user have browser window open it ...
3
votes
1answer
523 views

Rename standard field on Task

How to rename Call Result standard field on Task object.I don't see this field under Rename tabs and fields -> Tasks or Rename tabs and fields -->Activities.
3
votes
2answers
521 views

Entity 'Task' is not supported for semi join inner selects

I want add a default task to an opportunity when this one is close won and the opportunity hasn't any task. I get the error compiling the below code: Entity 'Task' is not supported for semi join ...
3
votes
1answer
1k views

Protected component checkbox in workflow task

While creating a new task for workflow there is a checkbox called Protected Component.from Help It says Check Protected Component to mark the task as protected.What does it mean by.Can someone explain ...
3
votes
1answer
637 views

Task owner does not change

When we change owner of a record (Ex opportunity) on Salesforce, there is a message at the top of the page saying : This screen allows you to transfer an opportunity from one user to another. ...
3
votes
1answer
58 views

Filter Id value 00BXXXXXXXXXXXX is not valid for the Task standard controller

Ok so I ran into something interesting today when trying to create a Visualforce button for the Task object. Everything was working gravy in Lightning. I was able to select records and everything ...
3
votes
3answers
369 views

How do you bring up the window showing Tasks?

There's a window that shows Tasks -- it may be called the "reminder window". It usually shows up when I log in, but somehow it got closed. How do you bring this window up? The Window I'll describe ...
3
votes
1answer
95 views

How to model life-events such as “married” and “bought house” in salesforce

I'm pretty new to Salesforce and therefore have not yet grasped the data model and the intended use for specific standard objects. I have to register life-events such as "married" or "bought a house" ...
3
votes
1answer
622 views

How to show inputField as just text on the VF page?

How to show apex:inputField on the VF page with pre-defined value as just text: In the below screenshot, the task status is shown as 'Completed', I want to do the same on the VF page that I am ...
3
votes
1answer
2k views

Lookup Field on Custom Object related to Activity (Task) (aka create a related list on Activities/Tasks)

This question seems to have been also asked here: Tasks and events custom related list with no resolution. I have the ZenKraft Shipmate UPS package installed in my organization, and I'm looking to ...

1 2 3 4 5 10