Question: As of [a previous question](https://sharepoint.stackexchange.com/questions/138802/setting-custom-field-default-value-within-itemadded-event?noredirect=1), whenever an item is added in a list, I create a document library based on a template, and set defaultvalues for some of its fields.
In Sharepoint Manager I see defaultvalues correctly set, but if I add an item to the document library, the fields are not filled with their expected default values: any hint?
I am running Sharepoint Foundation 2013.
This is the code:

```

public override void ItemAdded(SPItemEventProperties properties)
{
    SPWeb myWeb = properties.Web;
    string projectName = properties.ListItem["Project Name"].ToString();
    var customTemplate = myWeb.ListTemplates["ProjectTemplate"];
    Guid myItemGuid = myWeb.Lists.Add(projectName , projectName , customTemplate);

    SPList myItem = myWeb.Lists[myItemGuid];

    var projectCategoryField = myItem.Fields["Project Category"];
projectCategoryField.DefaultValue = "Test default value";
    projectCategoryField.Update();

    properties.ListItem.Update();
    base.ItemAdded(properties);
}

```

Answer: 
There was not an issue with the code nor the Sharepoint edition.
The issue was a somewhat scrambled list template, with multiple duplicate content types.
I recreated it and everything is OK.
This should work for you.  

You have to call the .Update() on the field not on the list.

```
public override void ItemAdded(SPItemEventProperties properties)
{
    SPWeb myWeb = properties.Web;
    string projectName = properties.ListItem["Project Name"].ToString();
    var customTemplate = myWeb.ListTemplates["ProjectTemplate"];

    myWeb.Lists.Add(projectName , projectName , customTemplate);
    SPList myItem = myWeb.Lists[projectName];

    //Is the field Project Category in your customTemplate
    SPField projectField= myItem.Fields["Project Category"];
    projectField.DefaultValue = "Test default value";
    projectField.Update()

    //properties.ListItem.Update();
    base.ItemAdded(properties);
}

```