To take full advantage of the REM functionality, perform some additional actions:

  1. Create a record extended model.
  2. Create necessary attributes and bind them to the model.
    • You can add attributes from the created model using the appropriate related list.
  3. Create a new widget using <rem> or <remform> SimpleTags (depending on whether the widget is intended for a record form or a portal page).
  4. Add the created widget to a record form or a portal page.

Use case 1


For example, you need to extend the Task (task) table with some attributes that allow you to handle some daily tasks. To do so, complete the following steps:

  1. Create an extension model for this table.

    Save the ID of the model. It will be used in the next steps.


  2. Create attributes.
  3. Create a form widget as described below and save it:

    <rem modelId="{data.model_id}" tableName="{data.table_name}" recordId = "{data.record_id}" />


    (() => {
      window.s_widget_custom = window.s_widget_custom || {};
      const parameter = new URLSearchParams(window.location.search).get('model_id');
      s_widget.setFieldValue('model_id', parameter);
      s_widget.setFieldValue('table_name', window.s_form.getTableName());
      s_widget.setFieldValue('record_id', window.s_form.getUniqueValue());
    })();


  4. Add this widget to the Task record form.
  5. Navigate to the record form using the URL https://instance.example.com/record/task?model_id=XXXX. Replace the XXXX in the URL with the ID of the model you created in step 1.

As a result, a form that contains the attributes of the specified model is displayed.

Use case 2


Use RE model to display attributes of some record on the form you need. For example, you need to see information about the user who initiated a task. This information is in REM attributes for the User (user) table. Here, you can add read-only REM attributes of the User (user) table to the Task (task) table. That is, you can display RE models of table A on the forms of table B.

To do so, configure the following entities:

  • RE model and its attributes for the User (user) table.
  • REM widget for the User (user) table.
  • REM widget for the Task (task) table.

To do this, complete the following steps:

  1. Create a widget for the User (user) table with the following values:

    Activetrue (selected)
    TablesUser


    <rem modelId="{data.model_id}" tableName="{data.table_name}" recordId = "{data.record_id}" />


    ( () => {
            window.s_widget_custom = window.s_widget_custom || {};
            const parameter = new URLSearchParams(window.location.search).get('model_id');
            s_widget.setFieldValue('model_id', parameter);
            s_widget.setFieldValue('table_name', window.s_form.getTableName());
            s_widget.setFieldValue('record_id', window.s_form.getUniqueValue());
    })();


  2. Create a RE model with the attributes you need for the User (user) table.

    Save the ID of the model. It will be used in the next steps.


  3. Add the widget you created in step 1 to the User form.
  4. Navigate to the record form using the URL looking like: Navigate to the record form using the URL https://instance.example.com/record/task?model_id=XXXX. Replace the XXXX in the URL with the ID of the model you created in step 2.

  5. Fill in the fields and save the record.
  6. Create a widget for the Task (task) table with the following values:

    Activetrue (selected)
    TablesTask


    <div>
    <rem modelId="{data.model_id}" tableName="{data.table_name}" recordId = "{data.record_id}" readOnly="true"/></rem>
    </div>


    ( () => {
     
                    s_widget.setFieldValue('table_name', 'user');
     
                    s_widget.setFieldValue('model_id', '{id of the RE model created on Step 2}');
     
                    s_widget.setFieldValue('record_id', '{id of the User record created on Step 4}');
     
                    s_widget.setFieldValue('table_name', 'task');
     
     
    })();
    
    


  7. Add the widget you created in the previous step to the Task form.

As a result, the Task form has read-only values of REM attributes from the User record.