Setting default values on Insert

Hi 


I have a form for editing/adding a new record (based on the music example). It has several DB linked controls (edits, no grids). I am trying to set default values when a new record is created but they are not showing up in the controls.

I am using the code in my form:

  EventEditDataset.Close;
  EventEditDataset.SetJsonData('{}');
  EventEditDataset.Open;
  EventEditDataset.Insert;

  VenueDataset.Load;

I have a set of default values for most fields and have tried setting them after the .Insert call, after the .Load call and in the dataset AfterInsertEvent. None of these populates the controls.

Any ideas?

Thanks

Russell

Hello Russell,

What is the code you tried to use after .Insert call?

the code is:


  EventEditDataSetEventDate.Value := DateOf(lDate);
  EventEditDataSetStartTime.Value := lDate;
  EventEditDataSetEndTime.Value := lEndDate;

We were able to reproduce and fix the issue. Fix will be included in next TMS Web Core release.

thanks.


Is it possible to get a dataset record from the XData Server which isn't posted to the database, so has no Id? That way all the logic could reside on the server.

I'm not sure I understand it. How that record without id would "enter" the server?