Hi Bruce,
I never got the “Save and get next record” in a NetWebForm to work in my application as it in the example application you prepared for me last year. As per thread:
http://www.nettalkcentral.com/index.php?option=com_smf&Itemid=36&topic=3526.msg13994#msg13994The objective was to press a “Save and Next” button on the form and input is validated and saved as usual, but instead of returning to the browse, the same form is loaded with the next record in the browse. The technique that you provided back in July of last year worked in the simple example program. But on more complex forms, the technique does not work. Last year, I was able to make a workaround by using a “Submit” button instead of a “Save” button for the “Save and Next” function that effectively did the save of the edited records as if in a memory form. If a “Save” button is used for the “Save and Next” function initial record is saved, however when the next record is loaded into the form, the form and will not save or validate the record when any of the save buttons on the form are pushed.
However now I want to create a form that will validate and save updates on form using the “Save” button because I will have a number save buttons on the form that will do different things before saving. I modified my View01 example program to simulate the problems that I am having with my current project. My current project does not use the same tables, but the View01 example displays the same problems. Compile View01.app and start the program. Click on the “Multi-Table Example” button. Select the first record and press the Change button. The ViewUpdateForm procedure form is displayed. This is the NetWebForm that I have tried to add a Save and Next buttons. The has four plain tabs on the form, a tab for each of three tables that are updated with this form and a tab for the update buttons. In the buttons tab there is a “Retrieve Next Record” check box. When checked, the save buttons should update the changes to the tables and retrieve the next S_AMASTER record and retrieve the records from related tables and display the form again. When unchecked the “Save” buttons save the current tables and return to the browse. Enter changes to the fields on the form, and press the “save” button. When the “Retrieve Next Record” is checked, these changes are properly saved and the next S_AMASTER record is retrieved by my GetNextRecord routine and loaded with the records from related tables into the form. Now there are two issues:
1) You will notice that only the S_AMASTER fields have the next record values, even though the records from the related tables are retrieved and loaded in to Session Variables. (see debug trace), they still show the previous record values. Also if you recompile the program and allow the “AssignedDate” field in the S_AMASTER tab be displayed. The Assigned Date field in the U_MASTER tab will show the correct value of the related U_MASTER record, but the other U_MASTER fields still show the previous record values. Weird.
2) You can not update or validate the records using the “Save” buttons now. Pressing the “Save” button just links back to the browse. Also no further stages are executed including the stage that executes the PostUpdate embed that contains the code from your Web1 example to call the form again. Basically the NetWebForm is not setup properly as it when called from the browse when updating the selected record. I think there must be some value queue fields that must be reset.
The code to the “Save and Next” is in the five embeds within the form, I believe the code is easy to understand. I uploaded both the View01 app and the Web1.app example that contains the code that you prepared to do the Save and Next last year. Currently, I am using NT 7.06, I did not realize that we are up to 7.10 already. Looking at the version update history, I do not think the newer NT version will make a difference. I hope that you can help me. Please post if you will give it a try.
Thank-you,
Rob Kolanko
[attachment deleted by admin]