I have a form to edit a user. It is called from the grid that shows all users. I want to use the SAME form, rather than a copy, so that the user can edit their own information. Something like adding a sc_select_where clause - but the sc_select_where macro only works on a grid. How can I, at run time, select a specific record when the application is started?
This should be easy… in the “SQL” of the Form just add a variable to the Where clause like this: UserRecNbr=[UserRecNbr]
So open your form and click on the “SQL” label on the left side, you will see a “Where” text box… that’s where you put the above.
All variables surrounded by square brackets [ ] are sessions variables that can be passed between applications. local variable for each app are surrounded by curly braces { }
Then when you create the edit link or a new link from a field on your grid you pass the UserRecNbr to it as a parameter. It will ask you what column or variable you wish to use to pass the data when you build the link.
If you build the grid and the form together using Scriptcase’s “Batch Applications” option it will do this for you and you will have a working example you can use to modify your existing grid and form.
Hope that helps!