How to Make a Field Editable if the Conditions Are Satisfied

Required Permissions

This section requires the Application Designer permission from your Domain's administrator.

Check What are the Design Tasks? to learn more about permissions to work with Design Mode and other tools.

Learn how to insert a Formula to make a row field's cell editable when the formula's conditions are satisfied.

Note

The procedure is the same for both Master and Detail tables.

For a Detail Table, you find the same interface by going into Details > [Desired Detail table] > Configure.

The action leads you to an interface that behaves like that of the Master Table in the Master sub-panel.

For more information about Details, check How to Attach a Table with Further Information to a Row: Detail Tables.

  1. In Design Mode, go to the table's settings containing the field column where you want to insert the Formula.

    For Master Table, you can find the table settings under the Master sub-panel. The Master sub-panel is the first panel opening by default when you access the Design Mode.

    For Detail tables, you must go to the Details sub-panel. Choose one of the Detail tables and click on Configure.

  2. In the table settings, click on the Restrictions tab. You find the tabs on the upper-right corner of the table settings.

  3. Click on the Cell Editability Restriction button in correspondence of the field to be restricted. You find the Cell Editability Restriction button under the Restrictions column. The action opens the Formula Editor.

    Example

    The Warehouse Orders manages orders from a warehouse. Each Master table's row stands for an order placed by a customer.

    Order Status tracks an order's state by recording the status' Id from a Storage containing the various statuses' names (e.g. "Placed", "Waiting for Payment", "In Preparation", and so on). A specific application enables to record the different statuses of Order Status.

    Each shipped parcel with items has its own tracking code. The users must register it in the Tracking Number field.

    Users should insert the tracking code if and only the order's status is either "Shipping from the Warehouse" or "Completed" and the field Order Shipment Date has a date.

    The solution here is employing a Cell Editability Restriction for the field Tracking Number's cells.

    The Designer goes to the Master table's settings in Design Mode. They click on Restrictions tab, then on the Cell Editability Restriction button in correspondence of the Tracking Number field.

    The Designer inserts the following formula:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    /*
    The formula checks:
    
    - if the order's status is either
    "Shipping from the Warehouse" OR "Completed"
    - the order's shipment date has been recorded
    
    If both (=AND()) the conditions are satisfied, it enables the Tracking Number field's editing.
    
    =EQ() function checks if two values are equal.
    OrderStatusId is the Numeric field recording the Id of the order's status.
    $CURRENTSTORAGE.OrderStatusId is a system variable referring to the value of OrderStatusId.
    "5" is the Id of the Order Status "Shipping from the Warehouse".
    "6" is the Id of the Order Status "Completed".
    
    =ISNOTNULL() function checks if a field's cell is not empty.
    In this case, =ISNOTNULL() checks if the field $CURRENTSTORAGE.OrderShipmentDate is empty or not. 
    $CURRENTSTORAGE.OrderShipmentDate is a system variable referring
    to the value of the field OrderShipmentDate.
    OrderShipmentDate records the shipment's date.
    
    The =OR() function accepts as parameters as any number of formulas.
    =OR() verifies that at least one of its parameters is satisfied.
    
    The =AND() function accepts as parameters as many formulas as desired.
    =AND() verifies that all the its parameters are satisfied.
    Only in this case the users can edit the field.
    */
    
    =AND(
          =OR(
                =EQ($CURRENTSTORAGE.OrderStatusId; 5);
                =EQ($CURRENTSTORAGE.OrderStatusId; 6)
         );
         =ISNOTNULL($CURRENTSTORAGE.OrderShipmentDate)
    )
    
    The Designer confirms and saves the changes in Design Mode.

    Now, the application enables editing for Tracking Number if and only if:

    • the order's status is "Shipping from the Warehouse" or "Completed".
    • the user ha recorded the order's shipment date.

  4. Click on the Save button to save the Cell Editability Restriction. You can find the Save button in the upper-left corner of the Design Mode.

Success

The application will unlock a cell to insert data if and only if the formula's conditions are satisfied.