If a screen is being used to add, view, or edit a record, the Screen Active Record ID is a Session Value that stores the Record ID of the record being added, viewed, or edited.
This value is important for those customizing Method, since the Screen Active Record ID is a way for Method to load data into fields on the screen, or save data from the fields of the screen into a new record.
For example, in the below image, an activity is being edited. The Record ID for this activity is 5. The Screen Active Record ID would store the value of 5, to let Method know we are viewing the record from the Activity table. Using the Screen Active Record ID, it knows what data from the table to pull so it can populate the fields on the screen.
A few things about the Screen Active Record ID:
The Screen Active Record ID only keeps track of one single numeric Record ID.
Every screen has its own Screen Active Record ID.
When the Screen Active Record ID is greater than zero,
Method will pull data from the base table of the screen.
In particular, it will pull data from the record which has the same Record ID value as held in the Screen Active Record ID.
Any field on the screen will be populated with record's associated data.
When the Save All action is used, the record will be updated with data from the fields on screen.
By default, the value for the Screen Active Record ID is -1.
Method will not pull data from the base of the screen, since there is no record with a Record ID of -1. All Record ID's are greater than zero.
When the Save All action is used, a new record will be inserted into the table using the data filled in the fields of the screen.
Once saved, the Screen Active Record ID is immediately updated to be the Record ID of the newly saved record.
NOTE: Method doesn't check to see if you have the correct Screen Active Record ID. In other words, if you wish to edit a record, but you put in the wrong number in the Screen Active Record ID, then the wrong record will be edited.
For example, if you accidentally put in the Contact's Record ID into a Screen's Active Record ID of a screen that is managing the Activity table, then you will be editing the wrong record.