(( () => {
window.s_widget_custom = window.s_widget_custom || {};
const modelIdparameter = new URLSearchParams(window.location.search).get('model_id'); // Getting model id from URL
//Setting model from model_id URL parameter so new record knows from which model to add attributes
s_widget.setFieldValue('model_id', modelIdparameter);
// Setting table name and record ID of existing record in order to find a model
s_widget.setFieldValue('table_name', window.s_form.getTableName());
s_widget.setFieldValue('record_id', window.s_form.getUniqueValue());
})(); |