Subject Re: [IBO] Master/detail don't work after set param manually
Author Delmar Wichnieski (Delta Corporation)
Hi Helen, thanks for your help

Sorry, now IBO4_8_7_Eval is installed successfully.

But the problem continues and now I think it is also a bug in version 4.8.7.
Seems clear that the parameter of master/detail stops update after executing the same query detail using a query parameter set manually.

below the application code for example

procedure TForm1.BitBtnMestreDetalheClick(Sender: TObject);
begin
//master/detail; program set the parameter
QdblookAluno.Close;
QdblookAluno.ParamByName('COD_ALUNO').Clear;
QdblookAluno.DataSource:=dsQmatriculasem;
QdblookAluno.Open;
end;

procedure TForm1.BitBtnParametroClick(Sender: TObject);
begin
//no master/detail; user set the parameter
QdblookAluno.Close;
QdblookAluno.DataSource:=nil;
QdblookAluno.ParamByName('COD_ALUNO').AsString:=edit1.Text;
QdblookAluno.Open;
end;

I look for comments

Regards

Delmar


----- Original Message -----
From: Helen Borrie
To: IBObjects@yahoogroups.com
Sent: Friday, June 20, 2008 8:16 PM
Subject: Re: [IBO] Master/detail don't work after set param manually


At 05:19 AM 21/06/2008, you wrote:
>Hi friends
>
>In one form X I have this mater/detail and work well
>
> dmComum.QdblookAluno.Close;
> dmComum.QdblookAluno.ParamByName('COD_ALUNO').Clear; //clear the param COD_ALUNO
> dmComum.QdblookAluno.DataSource:=dmsem.dsQmatriculaSem; //set the master datasource
> dmComum.QdblookAluno.Open;
>
>In other form Y I have and also work well
>
> dmComum.QdblookAluno.Close;
> dmComum.QdblookAluno.DataSource:=nil; //clear the master datasource
> dmComum.QdblookAluno.ParamByName('COD_ALUNO').AsString:=dmq.Qbusca.FieldByName('CODIGO').AsString; // set the same parameter manually
> dmComum.QdblookAluno.Open;
>
>but after to use the form Y e come back to for X, the mater/detail of form X don't work, it seem do not actualize the param COD_ALUNO
>
>this is a bug of IBO4.7.16?

That build of IBO is a beta version from January 2007!!! It undoubtedly has serious bugs, although your problem comes from wrong logic in your application workflow. The current release is 4.8.7.

> What could I do to solve the problem...

Fix the logic of your workflow.

1. In a master/detail relationship, the master dataset "drives" the detail dataset. (The detail dataset does not drive the master).

2. In an IBO application, the datasets govern what happens in the visual interface. So, if you set the dmComum.QdblookAluno.DataSource property in one place, then go to another part of your application and change it (or set it to Nil) then the original relationship is broken.

It *is* possible for a detail dataset to be used with 2 different master sets, but not simultaneously. If you need to swap the master datasource when the workflow jumps from one form to another then you must take care of the swapping before the user gets his eyes on the form.

Helen





[Non-text portions of this message have been removed]