Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linkage Service: Multiple retrieval arguments

Status
Not open for further replies.

Annelize

Programmer
Dec 17, 2004
45
0
0
GB
Hi all

Is it possible to have more than one retrieval argument when retrieving datawindows using the linkage service?

I have setup linkage as follows.
Code:
//Setup linkage between dws
dw_master.of_SetLinkage(TRUE)

//dw_discount_value linkage
dw_detail.of_SetLinkage(TRUE)
dw_detail.inv_linkage.of_SetMaster(dw_general)
dw_detail.inv_linkage.of_Register("colname", "colname")
dw_detail.inv_linkage.of_SetStyle(dw_detail.inv_linkage.RETRIEVE)

//set transaction object for the master
dw_master.inv_linkage.of_SetTransObject(SQLCA)
dw_master.Retrieve(arg1, arg2)

Then, to find a workaround, I have overidden the rowfocuschanaged event on dw_master, to retrieve dw_detail as follows:

Code:
if currentrow < 1 then return

arg1 = dw_master.getitemnumber(currentrow, "column_name")
dw_detail.retrieve(arg1, arg2)

This works for retrieval and the linkage service ensures my datawindows update in the correct order and foreign keys are correctly populated.

HOWEVER, as soon as I delete a row on dw_master and it retrieves the dw_detail after the succesful delete, I get the following error Retrieve argument 2 does not match expected type clearly indicating that it's trying to retrieve dw_detail without the 2nd argument.

Any advice?
Thanks!
Annelize
 
How are you handling the deletion of the child rows? You may wish to reconsider the code in the rowfocuschanged event which gets triggered as the focus changes in the parent when the row is deleted (place it somewhere else where it can be better controlled).

Matt

"Nature forges everything on the anvil of time
 
Thank you for your response, Matt. At the moment the child rows gets deleted when the master goes. I also have a cascade delete in my database.

Where do you suggest I move my code currently in the rowfocuschanged event to? I don't see how it's going to solve the problem of retrieving the child correctly with the 2nd argument included after deleting.

Linkage executes the rowfocuschanged event when I retrieve normally - this works. Even when I delete, the retrieval happens eventually, but before that in the pfc_rowfocuschanged event of the linkage service it bombs.
 
Bump...

Any linkage experts out there?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top