How to verify if DBPlanner.CreateItem works?

Hi Support.

I have an application that periodically does not seem to save an item to the database when I call the DBPlanner.CreateItem.

I am using DBPlanner version 3.0.0.3

For a currently unknown reason, periodically this does not save the item to the database, and I am trying to track down why.

I was hoping to determine from the function return value if there is a clue indicating why the item is not saved to the database.

my code fragment is as follows:
  with DBPlanner1.CreateItem do
  begin
    ItemStartTime   := PlannerNewTimeSetDlg.AdvDateTimePicker1.DateTime;
    ItemEndTime     := PlannerNewTimeSetDlg.AdvDateTimePicker1.DateTime+OneHour;
    ItemBeginPrecis := HourOfTheDay(PlannerNewTimeSetDlg.AdvDateTimePicker1.Time) * MinsPerHour;
    ItemEndPrecis   := (HourOfTheDay(PlannerNewTimeSetDlg.AdvDateTimePicker1.Time)+1) * MinsPerHour;
    Update;
    Refresh;
  end;

How can I determine why sometimes the database does not receive the new record, and yet other times it works fine (even without shutting down and restarting the application)?

In other words, sometime the function does not write the new record to the database with seemingly no error

This may of course be a SQL Server problem, but other parts of the application read and write records from the same database with no problems. Only the planner seems to have an issue - sometimes...

I was hoping that I could get some sort of return code from the actual CreateItem function indicating success or otherwise.

Thanks

Trevor

After the CreateItem call, the event OnItemToFields should be triggered. This is the first thing to check. After this, you should see a Post on your dataset. You should be able to check this from the event DataSet.BeforePost or DataSet.AfterPost.
If this sequence is not happening, it is possible that something in your dataset prevents it is being set in Edit mode.