Test class code coverage for createdfield I have an apex trigger that do the update the createddate field on parent when the child record is created. I'm not able to get the code coverage for the createddate field.  Thanks in advance  Here is the trigger:  trigger TriggerUpdateImplTestDate on Implementation_Facilities_In_Test__c (after insert) {    Map&lt;Id,Date&gt; parentimpl = new Map&lt;Id,Date&gt;();    for(Implementation_Facilities_In_Test__c imptest : trigger.new){     parentimpl.put(imptest.Parent_Implementation__c,Date.valueOf(imptest.CreatedDate));     }     List&lt;Parent_Implementation__c&gt; parentImplToUpdate = [Select Id,Implementation_Test_Results_Created_Date__c from Parent_Implementation__c where id in:parentimpl.keySet()];     for(Parent_Implementation__c pit : parentImplToUpdate ){     pit.Implementation_Test_Results_Created_Date__c = parentimpl.get(pit.Id);     }     update parentImplToUpdate;        }   Test Class:  @isTest   public class ImplementationupdatedateTests{  public static testMethod void testImplementationDateupdate() { Implementation_Facilities_In_Test__c impltest=New Implementation_Facilities_In_Test__c (); impltest.Name= 'Test1'; impltest.createdDate= insert impltest;   Parent_Implementation__c impl=New Parent_Implementation__c();  impl.Name='test';  insert impl;  } }
Unit testing code which has logic around the CreatedDate An example of the problem would be trying to test a trigger on a case which will fire on update, and look for time differences between when a case was created and now. Ideally in the unit tests I want to create a case with a CreatedDate in the past. The problem here is that CreatedDate is an audit field and not writeable[1]. Is there a standard work around to this problem?  [1] I know you can get audit fields turned on to be writeable temporarily when doing data migration. This is not a viable solution for every time you want to get your code coverage up for deployment.
How much marmelade can I bring into the US? I want to bring homemade berry marmelade in little glass jars with me to the US from Europe as gifts for friends. I have found the following site on importing foods into the US  and would assume that marmelade falls under the condiments category, which should be admissible. However, I am wondering however if there is any limit to how much one is allowed to bring. Will there be any issues if, say, I bring 3 kilograms (6 lbs 10 oz)?   Also on related note, would they be suspiscious when they see many glass jars in my bag? Do I risk getting my bag searched or getting asked what the jars are? Is there anything I can do to avoid any such trouble? Turn off autocomplete in PhpStorm I was answering a question on Stack Overflow and required to use a trailing space in one of my code snippets.  I formatted it like so:  `&lt;a `   And it renders without the trailing space: &lt;a  Using the &lt;code&gt; tag does account for trailing spaces, though in my case it busts because of the &lt;. Here's my formatting with the &lt;code&gt; tag:  &lt;code&gt;&lt;a &lt;/code&gt;   Here's how it renders:  (Yes, you should see nothing there).  This is a pretty annoying bug. Can we get it fixed? How can I manipulate field-based data from the commandline? For example   How can I print only lines whose Nth field is foo? How can I print only lines whose Nth field isn't foo? How can I print only lines whose Nth field matches foo? How can I change field N to foo?   Is there a standard approach or toolset that facilitates manipulating field-based data on *nix systems? How do I root my Android device? LaTeX package for syntax highlighting of code in various languages I am looking for a LaTeX package that does syntax highlighting on code. For example, right now I use the verbatim block to write code:  \begin{verbatim}     &lt;html&gt;        &lt;head&gt;            &lt;title&gt;Hello&lt;/title&gt;        &lt;/head&gt;        &lt;body&gt;Hello&lt;/body&gt;     &lt;/html&gt; \end{verbatim}   And this works fine to display the code on my document. But, suppose I wanted to highlight the HTML markup the way an IDE would in the output document? Is there a package that could help?  I would like to do the same for various languages such as Java, C#, HTML, CSS and so on. Is it possible to skip releases during an upgrade? Is a function defined at a single point continuous? Is a function defined at a single point continuous?  For example $f:\{0\}\to\{0\}$ defined by $f(x)=\sqrt{x}+\sqrt{-x}$ is a sum of two continuous functions and is therefore continuous, however for $f$ to be continuous, it has to have the limit $\lim\limits_{x_0\to x}f(x_0)=f(x)$ but it dosen't seem to have that limit. Convert generic List/Enumerable to DataTable? I have few methods that returns different Generic Lists.   Exists in .net any class static method or whatever to convert any list into a datatable? The only thing that i can imagine is use Reflection to do this.  IF i have this:  List&lt;Whatever&gt; whatever = new List&lt;Whatever&gt;();   (This next code doesn't work of course, but i would like to have the possibility of:  DataTable dt = (DataTable) whatever; Here's what I am trying to do:  1) User creates record A.  2) Time-based workflow sends an email to the Record A creator based on a date field in the record.  3) The email template has a URL link.  4) The URL links to a Visualforce page that is basically a form with fields to be filled out (this Visualforce page is in a managed package) and a save button that creates a new User record.  5) When the User clicks the URL link in the email, the Visualforce page opens in a new window.  6) I would like to pass the values of the fields in record A to pre-fill the Visualforce page fields.   Here's my link:  &lt;a href="https://cs19.visual.force.com/apex/CloneThisUser?Desktop=true&amp;Id={!Pending_User__c.User_to_CloneId__c}&amp;formGroupInputSmall={!Pending_User__c.First_Name__c}   And here's the code from the relevant section of the Visualforce page:  &lt;div class="form-group form-group-sm"&gt;       &lt;!-- &lt;apex:outputLabel styleClass="col-sm-2 control-label" for="formGroupInputSmall"&gt;First Name&lt;/apex:outputLabel&gt; --&gt;       &lt;div class="col-xm-11 col-sm-12"&gt;           &lt;apex:inputField html-placeholder="First Name" styleClass="form-control FirstNameInput"  value="{!u.FirstName}" id="formGroupInputSmall"/&gt;       &lt;/div&gt;     &lt;/div&gt;   I have only included the first field I would like to pass the parameter to, in order to keep this post simple.   The link passes the User_to_Clone_Id__c just fine but does not fill in the "First Name" field with the value of the First_Name__c .  What am I doing incorrectly? Thanks. My machine is currently running Windows 7. I have 2 partitions: OS (C:) and DATA (D:). I intend to do a native Ubuntu 14.04 install. Assuming I format my Windows OS partition, will I have full access to my D partition in Ubuntu ? In Minecraft, I know you can breed animals. In fact, in recent updates it's required for the player who just can't start their mornings without bacon and eggs!  I've tried pulling two pigs together in a single pen, but all they do is snort at me. And the chickens? Well, there's plenty of eggs, but no hatching.  How do I get them to make more bacon and eggs? data & synchronization - manually sync mail. calender and contacts Can one of Newton's Laws of motion be derived from other Newton's Laws of motion? Can one derive Newton's  second and third laws from the first law or   first and third laws from the second law or  first and second  laws from the third  law  I think Newton's laws of motions are independent to each other. They can not be derived from one another. Please share the idea. Whenever both my roommate and I use the wifi in a certain room in our apartment, it slows dramatically for me. It doesn't slow for him. If he uses it in another room, it's fine; if I use it in another room together with him, it's fine; it's just in this particular room. Does anyone know of a reason this could be? What's the best practice of inserting a collection of data into a SQL Server database I've just installed Ubuntu 14.04 and am trying to install php 5.3. But when I run   apt-get install php5    it's installing php 5.5.9-1ubuntu4. I need to use php 5.3 in the system because the application I'm working on is built with php 5.3.   How can I achieve this? Subscript labels in QGIS legends Is it possible to include subscript and superscript text in the title of a legend item in QGIS ?  I have tried using &lt;sub&gt;some text&lt;/sub&gt; but this just appears in the title with no change to the contents.  I am looking to have layer titles such as   Annual NO2 concentration (μg/m3)  The superscript is not a big issue, as I can use the character map to get a 3, but I don't know how to get the subscript. Methods to find $\lim\limits_{n\to\infty}\frac1n\sum\limits_{k=1}^nn^{1/k} $ What would you suggest here?  $$\lim_{n\to\infty} \frac{1}{n} \sum_{k=1}^{n} n^{1/k} $$ Why is setTimeout(fn, 0) sometimes useful?