Notifications

604 views

Description

Many-to-many related list does not automatically update when changes are made.

Steps to Reproduce

 

On a Geneva Patch 8 instance:

  1. Create Kits table.
    1. Navigate to System Definition > Tables.
    2. Click New
    3. Create a table with the following values and click Submit
      • Label: Kits
      • Name: u_kits
      • Extends Table: Hardware
  2. Create a many-to-many relationship for this Kits table.
    1. Enter sys_m2m.list in the navigation filter.
    2. Click New.
    3. Enter the following information and then click Create Many to Many.

      This creates a table called u_m2m_hardware_kits as a result.

      • From table: Kits [u_kits]
      • To table: Hardware [cmdb_ci_hardware] 
  3. Activate audit on the Kits table.
    1. Navigate to System Definition > Dictionary.
    2. Find the entry for the u_kits table with type = collection.
    3. Check the Audit check box and click Update.
  4. Activate audit on u_m2m_hardware_kits table.
    1. Navigate to System Definition > Dictionary.
    2. Find the entry for the u_m2m_hardware_kits table with type = collection
    3. Check the Audit checkbox and click Update.
  5. Create a new Kits record.
    1. Navigate to Kits > Kits.
    2. Click New.
    3. In the Name field, add "Test Kit" and save the record.
    4. Open Configure > Related Lists.
    5. Select Hardware in the slushbucket and click Save
    6. In the Hardware related list, click Edit.
    7. In the Collection list, select the first five records and move them to the Test Kit list and click Save.
  6. Verify the XML and history of these changes.
    1. In the Kits record, right-click the header and select Show XML.

      Note that the sys_updated_on = sys_created_on, and sys_mod_count = 0.

    2. In the Kits record, right-click the header and select History > List.

      Note that there are only updates with an Update number of 0.

  7. Delete the history to re-generate it.
    1. In the record history, click Delete.
    2. Navigate back to the Kits record.
    3. Right-click on the header and select History > List.

      Note that there are now five records with a label of Relation, a type of Relation, and an update number of -1. The relation records appear in the history only if the existing history is deleted and re-created.

Workaround

By default, insertions are not audited for any table. To enable auditing of insertions, set the glide.sys.audit_inserts system property to true. 

To cause the many-to-many related list to automatically update, create a business rule to run on the many-to-many table on insert, update, and delete that does one of the following: 

  • Sets the sys_updated_time of the parent record to the current time, which causes the history set for the parent record to regenerate.
  • Delete the history set for the parent record, which forces the history set to regenerate.  

 


Related Problem: PRB744027

Seen In

Geneva Patch 8

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2017-04-10 05:56:45
Published:2017-02-02