Pre-Populate Fields on Add from Search

To pre-populate fields from extended search parameters when adding a new record, use the following code in the row_rendering event.

If the field is a table lookup:

if (RowType == Config.RowTypeAdd) { // Add row
    CustomerId.AdvancedSearch.Load(); // Restore search value from session
    CustomerId.CurrentValue = CustomerId.AdvancedSearch.SearchValue;
}

If the field is a regular edit field:

if (RowType == Config.RowTypeAdd) { // Add row
    CustomerId.AdvancedSearch.Load(); // Restore search value from session
    CustomerId.EditValue = CustomerId.AdvancedSearch.SearchValue;
}