|
WinDev 7.5 - Why does this not work ? |
Started by Peter Purton, Apr., 19 2004 2:54 AM - 4 replies |
| |
| | | |
|
| |
Posted on April, 19 2004 - 2:54 AM |
Hi all I have a Customer file in form Mode. On it I am calling a linked Form from a Button. The code on the button is. -------------------------- // open the "Form_Maintenance" child window HReadFirst(Maintenance, MaintenanceID) IF HFound() THEN Open(Form_Maintenance,"Modify= AccountNumber=+Customer.AccountNumber") ELSE OpenForm_Maintenance, "Creation=AccountNumber=+Customer.AccountNumber") END --------------------------- This sort of works, but it is not Priming the Maintenance Form being called With the Customer.AccountNumber I have lost the Plot here. Any advise welcome. TIA Keep well Peter Purton |
| |
| |
| | | |
|
| | |
| |
Posted on April, 19 2004 - 5:08 AM |
Peter, There're some missing out in your code, they are 1. HReadSeek(Maintenance, MaintenanceID, InputID) 2. //Switch to the right key in the init of Form_Maintenance //Switch back the parent's index 3. //IF both parent and the child are the same key, ignore (2) 4. Open(Form_Maintenance,"Modify= AccountNumber=Customer.AccountNumber") 5. //You have the same line of code in IF and ELSE, strange..., so I guess // (4) is correct one. Keep well King
Hi all I have a Customer file in form Mode. On it I am calling a linked Form from a Button. The code on the button is. -------------------------- // open the "Form_Maintenance" child window HReadFirst(Maintenance, MaintenanceID) IF HFound() THEN Open(Form_Maintenance,"Modify= AccountNumber=+Customer.AccountNumber") ELSE OpenForm_Maintenance, "Creation=AccountNumber=+Customer.AccountNumber") END --------------------------- This sort of works, but it is not Priming the Maintenance Form being called With the Customer.AccountNumber I have lost the Plot here. Any advise welcome. TIA Keep well Peter Purton |
| |
| |
| | | |
|
| | |
| |
Posted on April, 19 2004 - 8:20 AM |
Hi Thanks for the Input. But the Maintenance Form being called from the Customer Form is a 1 to 1, so there will only Ever be 1 Maintenance Record with Call Outs attached. Thanks for your advise. BTW what did you mean by
2. //Switch to the right key in the init of Form_Maintenance //Switch back the parent's index Thanks again Keep well Peter Purton
Peter, There're some missing out in your code, they are 1. HReadSeek(Maintenance, MaintenanceID, InputID) 2. //Switch to the right key in the init of Form_Maintenance //Switch back the parent's index 3. //IF both parent and the child are the same key, ignore (2) 4. Open(Form_Maintenance,"Modify= AccountNumber=Customer.AccountNumber") 5. //You have the same line of code in IF and ELSE, strange..., so I guess // (4) is correct one. Keep well King Hi all I have a Customer file in form Mode. On it I am calling a linked Form from a Button. The code on the button is. -------------------------- // open the "Form_Maintenance" child window HReadFirst(Maintenance, MaintenanceID) IF HFound() THEN Open(Form_Maintenance,"Modify= AccountNumber=+Customer.AccountNumber") ELSE OpenForm_Maintenance, "Creation=AccountNumber=+Customer.AccountNumber") END --------------------------- This sort of works, but it is not Priming the Maintenance Form being called With the Customer.AccountNumber I have lost the Plot here. Any advise welcome. TIA Keep well Peter Purton |
| |
| |
| | | |
|
| | |
| |
Posted on April, 20 2004 - 12:25 AM |
Bonjour Pedro, Clarion automatically primes fields with relationships, WD does not. You must manually prime by filling the related field from the field in the open record. I their is no other file access happening about the place the parent record will be the one held in memory and automaticlly referenced by your code, so you can keep the access code simple. File2.field = File1.field anywhere in the create process (after the reset) will set the value for you. Gill
Hi Thanks for the Input. But the Maintenance Form being called from the Customer Form is a 1 to 1, so there will only Ever be 1 Maintenance Record with Call Outs attached. Thanks for your advise. BTW what did you mean by 2. //Switch to the right key in the init of Form_Maintenance //Switch back the parent's index Thanks again Keep well Peter Purton Peter, There're some missing out in your code, they are 1. HReadSeek(Maintenance, MaintenanceID, InputID) 2. //Switch to the right key in the init of Form_Maintenance //Switch back the parent's index 3. //IF both parent and the child are the same key, ignore (2) 4. Open(Form_Maintenance,"Modify= AccountNumber=Customer.AccountNumber") 5. //You have the same line of code in IF and ELSE, strange..., so I guess // (4) is correct one. Keep well King Hi all I have a Customer file in form Mode. On it I am calling a linked Form from a Button. The code on the button is. -------------------------- // open the "Form_Maintenance" child window HReadFirst(Maintenance, MaintenanceID) IF HFound() THEN Open(Form_Maintenance,"Modify= AccountNumber=+Customer.AccountNumber") ELSE OpenForm_Maintenance, "Creation=AccountNumber=+Customer.AccountNumber") END --------------------------- This sort of works, but it is not Priming the Maintenance Form being called With the Customer.AccountNumber I have lost the Plot here. Any advise welcome. TIA Keep well Peter Purton |
| |
| |
| | | |
|
| | |
| |
Posted on April, 20 2004 - 2:17 AM |
Hallo Gill Thanks, I knew that I could add it To the Form being called, In the ModifyWindowMode After IF Left(gWindowMode,~="Creation" THEN Just thought there may be a more elegant way. Thanks again. Keep well Peter Purton
Bonjour Pedro, Clarion automatically primes fields with relationships, WD does not. You must manually prime by filling the related field from the field in the open record. I their is no other file access happening about the place the parent record will be the one held in memory and automaticlly referenced by your code, so you can keep the access code simple. File2.field = File1.field anywhere in the create process (after the reset) will set the value for you. Gill Hi Thanks for the Input. But the Maintenance Form being called from the Customer Form is a 1 to 1, so there will only Ever be 1 Maintenance Record with Call Outs attached. Thanks for your advise. BTW what did you mean by 2. //Switch to the right key in the init of Form_Maintenance //Switch back the parent's index Thanks again Keep well Peter Purton Peter, There're some missing out in your code, they are 1. HReadSeek(Maintenance, MaintenanceID, InputID) 2. //Switch to the right key in the init of Form_Maintenance //Switch back the parent's index 3. //IF both parent and the child are the same key, ignore (2) 4. Open(Form_Maintenance,"Modify= AccountNumber=Customer.AccountNumber") 5. //You have the same line of code in IF and ELSE, strange..., so I guess // (4) is correct one. Keep well King Hi all I have a Customer file in form Mode. On it I am calling a linked Form from a Button. The code on the button is. -------------------------- // open the "Form_Maintenance" child window HReadFirst(Maintenance, MaintenanceID) IF HFound() THEN Open(Form_Maintenance,"Modify= AccountNumber=+Customer.AccountNumber") ELSE OpenForm_Maintenance, "Creation=AccountNumber=+Customer.AccountNumber") END --------------------------- This sort of works, but it is not Priming the Maintenance Form being called With the Customer.AccountNumber I have lost the Plot here. Any advise welcome. TIA Keep well Peter Purton |
| |
| |
| | | |
|
| | | | |
| | |
|