Previously, we set up the New Car screen with a second version so we could alter it to serve a second purpose: Editing a car.
Rename the Screen
Customize the New Car screen.
Select the NewCar text object and change the text to New / Edit Car.
Go to the properties of the screen itself by clicking the paper icon.
Change the Name of the screen to New / Edit Car.
Save the Screen and Close it.
Wow! We didn't do much other than rename the screen! However, how can we use it to edit a car? The easiest way to do that would be to click on a car on the grid in the Car List screen. So let’s set up the functionality!
Editing Car List Grid
Go to the Car List screen and click Customize.
Click the down arrow on the GridCar object and select the Row Click Event.
Find and add the action Go To Screen.
Under Navigate to, choose Cars app. For the new dropdown that appears, choose the New / Edit Car screen.
For Set a screen active record ID, select Set Active Record ID.
For Use this active record ID, search for and choose GridCar - Record ID.
Remember to include an Internal Note: “Go To New / Edit Car Screen”.
Close the Action Editor and then close Design Mode.
Now, when you take a look at GridCar, do you notice something? The rows have arrows on them, and they are selectable! When you click on a row, you are taken to the New / Edit Car Screen, and the details for the Car you have chosen are already in the fields. You now have the ability to make edits to those fields, then click Save to resave the entry with the updated information.