Subject | Re: [IBO] Posting a new record in a Dataset linked to a TIB_Grid |
---|---|
Author | Helen Borrie |
Post date | 2005-09-15T11:33:32Z |
At 10:19 AM 15/09/2005 +0000, you wrote:
procedure TdmMyDm.IB_QueryContaAfterInsert(IB_Dataset: TIB_Dataset);
begin
IB_Dataset.FieldByName('REGH').AsString := '10010001';
end;
Note also that, if all inserts are to receive the same value, you can set
that value as a default in the Fields Attributes.
Helen
>I am using a TIB_Grid linked to a TIB_DataSource and a TIB_Query.Notice the argument ((IB_Dataset: TIB_Dataset)
>I have this code at IB_QueryContaAfterInsert event:
> FieldByName('REGH').AsString := '10010001';
>For a new record, the user types values for other fields on the
>TIB_Grid. Field REGH is not visible on the grid, so user cannot change
>it. When posting record, I got this ISC Error Message:
> ISC ERROR CODE: 335544347
> validation error for column REGH, value "***null***"
>How can it happens, since the field was assigned to '10010001' at
>AfterInsert event?
procedure TdmMyDm.IB_QueryContaAfterInsert(IB_Dataset: TIB_Dataset);
begin
IB_Dataset.FieldByName('REGH').AsString := '10010001';
end;
Note also that, if all inserts are to receive the same value, you can set
that value as a default in the Fields Attributes.
Helen