New answers tagged

0

First principles - don't put your whole SOQL on 1 line - too hard to read/debug If you have shared activities enabled, you'll need to query from Contact via relationship TaskRelations and because TaskRelation has a lookup field to the Task, you can filter on the TaskRelation that has the most recent Task.LastModifiedDate return [SELECT Id,Firstname,...


0

You can create a new Custom Field on the Activity sObject and use that field in the Email Template. The custom field is just a text formula and can be something like Owner_Name__c = Owner:User.Full_Name__c, where Full_Name__c is a custom name field on User sObject, then in your Email Template, you can use something like {!Task.Owner_Name__c}


2

You are going to have to post process the result - the owner name is there, but you will need to iterate through the array to extract it. The reason you can't see it is because the query viewer is not capable of showing deeply nested objects - you need to serialize it to JSON and then examine that. I wrote this little query to get the output below: Contact[] ...


0

As shown here, the trigger shouldn't work for any of the scenarios (except Scenario 2, which if I understand correctly is the OOTB behavior) due to what I think is just a typo: if (tsk.OwnerId == Trigger.Oldmap.get(tsk.WhatId).OwnerId) { tsk.OwnerId = Trigger.Oldmap.get(tsk.WhatId).OwnerId; The if condition should be !=.


1

Per the documentation, you cannot set the value of CompletedDateTime.


1

I changed the separator list of my computer and Excel to comma(,) And I changed the Excel's language to English.


1

Here is a possible answer to your question: If you are logged in as that user than I believe $User.Id should resolve to the logged in UserId. To reinforce this, if the logged in user can access dev Console, try running the following code in the Dev. Console execute anonymous: System.debug(UserInfo.getUserId()); See which Id is outputted to the debug log. ...


Top 50 recent answers are included