Subject | RE: [IBO] Re: Valide of Fields |
---|---|
Author | Jason Wharton |
Post date | 2004-11-18T23:49:15Z |
This doesn't look like an appropraite use of the OnValidateFields event.
What are you trying to do?
Jason Wharton
What are you trying to do?
Jason Wharton
> -----Original Message-----
> From: nelsonvechini [mailto:nelsonvechini@...]
> Sent: Friday, November 05, 2004 5:45 AM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] Re: Valide of Fields
>
>
>
>
> Excuse, I wrote in Portuguese...I imagined that somebody of Brazil
> was able to me to answer.
>
> Here it is going in English:
>
> The code of the event onValidateFields is:
>
> begin
> IF (AFIELD.FIELDNAME <> ' CODPRODUTO') OR
> (ARow.Columns[0] .IsNull) or
> (ARow.Columns[0] .AsString = ' 0 ') or
> (ibVenda.State = dssBrowse) then
> Exit;
>
> q.Close;
> q.SQL.Clear;
> Q.SQL.ADD (' SELECT CODPRODUTO, VALORVENDA, CODUNIDADE FROM
> PRODUTO');
> Q.SQL.ADD (' WHERE CODPRODUTO = ' + TRIM(AROW.COLUMNS
> [0] .ASSTRING));
> q.Open;
>
> if q.RecordCount = 0 then
> begin
> MessageBox(Application.Handle,
> Pchar (' Product not registered.
> Verify!! '),
> ' Consistence of Data', MB_ICONASTERISK +
> MB_OK);
> end;
>
> IBVENDA.FIELDBYNAME (' QTDE') .VALUE := 1;
> IBVENDA.FIELDBYNAME (' VALORUNIT') .VALUE := Q.FIELDS
> [1] .VALUE;
> IBVENDA.FIELDBYNAME (' CODUNIDADE') .VALUE := Q.FIELDS
> [2] .VALUE;
>
> They put he doesn't catch only the field CODPRODUTO, he passes
> several times. It seems that catches only the primary key.
>
> In relation to the content of Getting Started Guide, would like to
> find this treatment type ...I suppose that is basic.
>
> Hugs