Search Knowledge Base by Keyword

Update Column Value on Asset

< Back

The Update Column Value on Asset action button updates the column value of an asset type when clicked. There are options that can be configured to show or hide the confirmation modal. The configuration information is outlined below.

Front-End (HTML)

  1. The HTML in this example is being used to render a confirmation modal (pop-up) before the assets are updated. It is a fail-safe to prevent users from accidentally highlighting a row in the report and clicking the action button without confirmation.
    1. The confirmation modal can be turned on or off with a JS variable (confirmation_modal)
  2. There are a number of colors that can be utilized for the confirmation modal. To change the default green color in the example, update the CSS class definition on Line 1. You can also remove the color specific CSS class to get a generic white modal.

    1. Available colors:
      1. modal-primary – ReadyWorks Blue
      2. modal-info – Light Blue
      3. modal-success – Green
      4. modal-warning – Amber
      5. modal-danger – Red
  3. If using more than one action button on a report, you will need to make sure the id on Line 1 of the modal div is unique for each modal. In this example, we are using value_change_modal for the id. This is also defined again as a variable on Line 2 in the JS.
  4. Update the modal-title on Line 7 to the desired text to display at the top title portion of the confirmation modal

Front-End (JS)

  1. The JS client-side code is being used to interact with the HTML DOM. It has standard code to render the action button on the report, and provide controls and event listeners for the action button.
  2. Toggle the confirmation_modal variable on Line 1 to true to show the confirmation modal, or false to bypass the confirmation modal
  3. If changing the modal id from HTML in the step above, then you will need to make sure the same modal id is defined in the modal_id JS variable on Line 2
  4. Update the action button title text on Line 24 to display the desired text when an end user hovers over the action button on the report
  5. Update the CSS icon used by the action button on Line 24. For a complete list of available Icon Class names, visit the Icon Library tab.

Backend (PHP)

  1. Backend server-side processing is handled inside of this PHP space. A few pre-defined variables need to be updated to account for the Asset Type Id, column name, and new value.
  2. Update the $atype_id variable on Line 21 to the Asset Type Id of the asset type being updated
  3. Update the $column_name_change variable on Line 22 to the column name of the column being updated inside of the Asset Type Id defined in the previous step
  4. Update Line 23 to the value that you are assigning to the column in the previous step. For lookup and alias columns, the format of the value is AssetTypeId__AssetId where the AssetTypeId is referencing lookup/alias list asset type Id, and the number after the __ is the asset Id of the lookup value. For non-lookup columns, the actual value can be set to this variable.
  5. For the values provided in the example:
    1. The action button is being used to update the Server asset type with an Asset Type Id of 29
    2. The lu__state lookup column on the Server asset type is being updated
    3. The State asset type has an Asset Type Id of 3
    4. The Decommissioned list item inside of the State asset type has an Asset Id of 9. This is how the new column value is set to 3__9.

General Information

  1. Click the  button to choose if the action button supports selection of single or multiple datatable rows. The code inside the action button supports both approaches. If Single Select is selected, then only one record at a time can be updated. If Multi Select is selected, the user can select more than one row to update in bulk.
  2. Click the button to bring op the Button Properties dialog to assign the action button to a report
    1. Configure the button properties and then click the Update button. Click the Close button to cancel the operation.

      1. Name – Name of the action button (required)
      2. Status – Choose if the action button is enabled (required)
      3. Apply to Reports – Select report to apply the action button to
        NOTE: Action buttons can also be assigned to reports in the Report Builder.
  3. Click the  button to save the action button