Page 1 of 2

strange behaviour in new component (master detail)

Posted: Mon 25 Aug 2008 04:38
by lifeform
hello
i have master and detail list
master have to save and detail just show the info of master record
when the master not post the detail info not show up. how ever it;s work when i use sdac 4.3 version.

the detail linked to master. detail mastersource filled to datasource og master. and i use query parameter to link it

how to fix it?

Posted: Mon 25 Aug 2008 04:45
by lifeform
how strange... i rollback the component to 4.35 version
and the application run perfectly

when i use the 4.50.36 or 4.50.37 the program not complete.
it's very strange behaviour because i use the new version. not the old ones.

for the example:

i use 2 TMSQuery. 2TMSDatasource
the first i named master and the second i named it detail
the detail query masterSource i linked to master datasource
for the exampe the field in master query is supplierID and date
and sql in detail query is

Code: Select all

select * from item where SupplierID = :supplierID
when i run the program i click the button that i send the value '0001' to supplierID in master query
for the example

Code: Select all

  masterQuery.fieldByName('supplierID').value := '0001'
i not post the master query because i need to cek the some parameter
and before post the master query i need the detail query to show the result. (this can be done in sdac ver 4.35)


please tell me how to fix it in the new version of component.

thx

Posted: Wed 27 Aug 2008 11:33
by Dimon
I could not reproduce the problem.
Please send me a complete small sample at dmitryg*devart*com to demonstrate it, including script to create and fill table.

Also supply me the following information:
- the exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- the exact version of your IDE.

Posted: Sun 31 Aug 2008 07:37
by lifeform
i already sent the small example for you
please check and confirm

Posted: Mon 01 Sep 2008 12:39
by Dimon
Thank you for information. We have reproduced the problem.
This behaviour has been changed for perfomance increase on records inserting, because when using master/detail relationship the existence of a detail record presupposes the existence of a master record.
To view the existing record you can use the Filter property. You can look at the example of using this property in the FilterAndIndex demo of the SDAC demo.

Posted: Mon 08 Sep 2008 13:19
by lifeform
Dimon wrote:Thank you for information. We have reproduced the problem.
This behaviour has been changed for perfomance increase on records inserting, because when using master/detail relationship the existence of a detail record presupposes the existence of a master record.
To view the existing record you can use the Filter property. You can look at the example of using this property in the FilterAndIndex demo of the SDAC demo.
because i really need this function that i describe above, how to force it to get like that?
if i use filter, it's will be very slow because i must transfer all date to client program. please tell me how to done it well

thx

Posted: Mon 08 Sep 2008 15:01
by Dimon
We have investigated the problem. We will add the possibility of using the old behavior in the next SDAC build.

Posted: Sun 14 Sep 2008 07:39
by lifeform
ok i will be waiting before update

Posted: Mon 22 Sep 2008 15:54
by lifeform
I have try your new build version 4.50.39
and the problem of mine still cannot solved...
and you promised me to add possibility of old behavior master detail
if you have done with this how to make it work in old behavior?
i have try activated the local master detail but the master detail cannot work properly

please help and thx before

Posted: Tue 23 Sep 2008 06:46
by Dimon
To restore the old behavior, you should set the RefreshParamsOnInsert variable to True in the initialization section of one of the units in your project.
This varible is declared in the DBAccess unit.

Posted: Tue 23 Sep 2008 20:09
by ccmcbride
Does that have to be in a specific place?
I added to my global form's initialization logic, but doesn't seem to be working.
Please note : my detail table is already open.
I do an insert on the master, and my detail doesn't keep up.

Posted: Wed 24 Sep 2008 01:52
by lifeform
it's work for me
i do it in my form parent after the form created and before the query activated
i just add line "refreshParamOnInsert:=True"
it's done. my app works well.
absolutely thx for SDAC developer

Posted: Wed 24 Sep 2008 01:57
by ccmcbride
I moved it to when my main form is created, before the datamodules get created, still not working.
Is there another setting that effects it?

Posted: Wed 24 Sep 2008 02:33
by lifeform
this master detail linked by parameter in SQL statement
so this detail query need to declared the datasource
and my app use it when the master query in insert or edit state mode
try to insert new record that the ID linked to detail query that param refer to the ID
and i don't use fetchAll. but i thinkn this is not effect the behaviour of master detail.

if you use datamodule i think that the line of RefreshParamOnInsert should be put after form create and/or before the query activated
i just make suggestion here because i don't really understand how the SDAC really work. i make suggestion depend on trying and error that i got.

Posted: Wed 24 Sep 2008 06:41
by Dimon
You can set RefreshParamOnInsert to True in any place before opening tables, that takes part in master/detail relationship.