Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Import CSV file

Hi, There seems to be a bug that whenever I try to import CSV into the codeOntime. I got error from the email log said "Object reference not set to an instance of an object.
Country_Name=Singapore;"

When I debug the code, I found out that the cause is due to the generated code for Updated_By and Update_Date which I have set to automatically create upon insertion.

The generated code as follows:
[ControllerAction("Country", "Insert", ActionPhase.Before)]
[ControllerAction("Country", "Update", ActionPhase.Before)]
public void AssignFieldValuesToCountry(int? country_Id, string country_Name, string updated_By, DateTime? updated_Date)
{
FieldValue Updated_ByFieldValue = SelectFieldValueObject("Updated_By");
Updated_ByFieldValue.NewValue = Context.User.Identity.Name;
Updated_ByFieldValue.Modified = true;
Updated_ByFieldValue.ReadOnly = false;
FieldValue Updated_DateFieldValue = SelectFieldValueObject("Updated_Date");
Updated_DateFieldValue.NewValue = DateTime.Now;
Updated_DateFieldValue.Modified = true;
Updated_DateFieldValue.ReadOnly = false;
}

The SelectFieldValueObject() function and context returns null and therefore create an exception. The same code works for normal insertion though.

Pls help.
4 people have
this problem
+1
Reply