TDBPlanner: FieldsToItem - Number of Fields

I don't have all the fields with DataSource - TFDQuery

REATE TABLE PLANNERS (
  IDPLANNERS PRIMARYKEY NOT NULL,
  STARTTIME STAMP NOT NULL,
  ENDTIME STAMP NOT NULL,
  SUBJECT TEXT050,
  NOTES MEMO,
  COLOR INTEGERVAL,
  IMAGE INTEGERVAL,
  CAPTIONTYPE SMALLINTVAL DEFAULT 0 NOT NULL,
  RESOURCE INTEGERVAL,
  RECURRENCY MEMO,
  MINTIME STAMP,
  MAXTIME STAMP,
  SHAPE SMALLINTVAL DEFAULT 0 NOT NULL,
  ALARMACTIVE BOOLINT DEFAULT 0 NOT NULL,
  ALARMMESSAGE TEXT100,
  ALARMNOTIFYTYPE SMALLINTVAL DEFAULT 0,
  ALARMTIME SMALLINTVAL DEFAULT 0,
  ALARMTIMEAFTER STAMP,
  ALARMTIMEBEFORE STAMP,
  ALARMADRRESS TEXT100,
  URL MEMO);

fdqryHalfDayPeriod
SELECT
  P.IDPLANNERS, P.STARTTIME, P.ENDTIME, P.SUBJECT, P.NOTES, P.COLOR, P.IMAGE, P.CAPTIONTYPE, P.RESOURCE,
  P.RECURRENCY, P.MINTIME, P.MAXTIME, P.SHAPE,

  P.ALARMACTIVE, P.ALARMMESSAGE, P.ALARMNOTIFYTYPE, P.ALARMTIME, P.ALARMTIMEAFTER, P.ALARMTIMEBEFORE,
  P.ALARMADRRESS, P.URL
FROM PLANNERS P

  Item.Alarm.Active := TBasicFunction.IntToBool(Fields.FieldByName('ALARMACTIVE').AsInteger);type or paste code here

Project JasotSVB.exe raised exception class EDatabaseError with message 'fdqryHalfDayPeriod: Field 'ALARMACTIVE' not found'.

Fields: 13 x. Exists 21.

Is it effectively added to your dataset?

What do you mean? I have FDQuery. The DataSource is connected to it and the TDBxxSource to DataSource. If it weren't for that, nothing would work.
The number of fields essentially corresponds to the fields that can be set in TDBxxSource. All other fields are ignored. In my case, all ALARMxxx fields.
I have a feeling that you have not treated the Alarm against the DB at all.

If you get:

EDatabaseError with message 'fdqryHalfDayPeriod: Field 'ALARMACTIVE' not found'.

that means fdqryHalfDayPeriod performs datasource.Dataset.FieldByName('ALARMACTIVE') and this field is not in DataSource.DataSet.

So, check your connected dataset.

I know what you wrote me. That's why I sent you the table structure and SQL.Text
I checked it several times and I don't see a mistake there. I don't know if this also applies to other TDBxxSource.
Edit:
This applies to all TDBxxSource

FieldsEditor :hot_face: