Hello,
A small question.
I have a TDBPlanner with a TDBDaySource in datasource running in dmMultiResource mode.
I use the event on datasource OnInsertItem to record or update my new item in my database.
In this event, I need the ResourceId that corresponds to the column where I drop my item.
In my dataset behind my Item, this value is still = 0 (at this moment).
So after, I use the event PositionToResource to update my dataset like this :
procedure TFBonRepPlan.DBDaySource1PositionToResource(Sender: TObject;
Field: TField; Position: Integer);
begin
inherited;
BonRepPlanManager.BonRepPlanTable.FieldByName('ResourceID').AsInteger := Position;
end;
But for me it's too late.
Can you tell me if it is possible to have this ResourceId data in OnInsertItem event.
THanks !!
Did you try in OnInsertItem to get the position from APlannerItem.ItemPos ?
Thanks for your answer.
Unfortunately inside event
DBDaySource1InsertItem(Sender: TObject;
APlannerItem: TPlannerItem);
the APlannerItem.ItemPos is 0 .
;/ I'm really blocked with this problem ...
I check your demos.
In a TPlanner, the "position" parameter is present in the ItemInsert signature.
But in a TDBPlanner,... i have only a PlannerItem with ItemPos = 0 ...
In your demos, if i'm right i don't find any example with a TDBPlanner using a ResourceDatasource.
Can you confirm?
thanks a lot !
Ok i found my error.
The value is automatically updated in my dataset thanks to mapping in datasource resourceId property.
Topic closed ;)