0

I'm using the Task's multiple users function but copies of the same task records are created when I create a task.

So I'm thinking of creating a trigger to synchronize these tasks.

My criteria to find the 'Same' task is by comparing the WhatId, WhoId, Subject and most important CreatedDate.

So I have questions here:

  1. Are those Tasks that created by multiple user selected have the same "createddate" value?

  2. If I put Task records into a List, and run insert on the List, are those tasks in the list have same "createddate" value?

  3. What is the 'CreatedDate" field's precision and can I set the precision in SOQL so I can compare by the minute or second precision?

0
  1. Are those Tasks that created by multiple user selected have the same "createddate" value?

Currently you can assign task upto 50 people, so it is 50 records salesforce needs to process. Most likely they will have same createddate but there is no guarantee to be this way.

  1. If I put Task records into a List, and run insert on the List, are those tasks in the list have same "createddate" value?

Depending on number of records you are trying to process, it may or may not have same created date. For instance, I tried with 100 records, with same date. But 200 records end up with different dates.

  1. What is the 'CreatedDate" field's precision and can I set the precision in SOQL so I can compare by the minute or second precision?

Salesforce DateTime fields follows milliseconds precision since they follow Unix Time but all audit fields follow seconds precision even though they are DateTime fields (thanks @sfdcfox)

| improve this answer | |
  • singularity, thank you for the clear explanations. Is there a way to compare two createddate in SOQL using second as the time precision? – sfdcnoob Feb 23 '15 at 19:03
  • Salesforce audit fields only use second precision. The milliseconds value is always zero. – sfdcfox Feb 23 '15 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.