39 views

Description

Importing domain records without the parent domain record results in NULL or invalid domain path.

Steps to Reproduce

  • 1: Importing new domains with parent imported after child.

    1. Create a domain hierarchy on one instance (Inst1) where domain D-1-1 is a child of domain D-1 and D-1 is a child of TOP(OOO domain).

    2. Export the two domain records separately.

    3. On another instance (Inst2), import domain record D-1-1.

    4. Import domain record D-1.

      Result: Domain record D-1 is created with NULL sys_domain_code and sys_domain_path.

      All the data records belonging to these domains cannot be retrieved by users belonging to these domains.

      Workaround: Run fixDomainTable API in DomainPathValidator.

  • 2: Change the parent domain of an existing domain to a non-existing domain using XML import.

    1. Create a domain hierarchy on Inst1 where domain D-1 and D-A are children of TOP(OOO domain).

    2. Export the XML for domain D-1.

    3. On Inst2, import domain record D-1.

    4. On Inst1 change the domain D-1's parent to D-A.

    5. Export D-1's domain record and import into Inst2.

      Result: The sys_domain_code and sys_domain_path of D-1 is set to the value in the import XML. However, since parent domain D-A does not exist on Inst2, a Domain Hierarchy Change scheduled job is not scheduled.

      For all the children under D-1, the sys_domain_path is not recalculated.

      All the data records belonging to these domains therefore cannot be retrieved by users belonging to these domains.

  • 3: Set an invalid sys_domain_code and sys_domain_path for domains with a NULL parent.

    1. Create a domain P-1 at the top level with no parent on Inst1.

    2. Export the XML for domain P-1.

    3. Remove this line "<parent display_value="">.

    4. Change the value of sys_domain_path and sys_domain_code to "junk".

    5. On Inst2, import domain record P-1.

      The sys_domain_code and sys_domain_path of P-1 is set to the value in the import XML, junk.

      All the data records belonging to this domain cannot be retrieved by users belonging to these domains.

 

Workaround

Use one of the following workarounds to fix this issue:

  1. When exporting/importing domains, sort the list by sys_domain_path.

    That will result in parents on the top of the list.

  2. Re-import the same domains twice.

    That will re-calculate and fix the NULL values for paths and codes

  3. Run the following script to fix the domain paths, assuming that all the parents were already imported.

    // Fix domain table code and path:
    var pathValidator = new GlideDomainPathValidator();
    pathValidator.setUpdateProgress(false);
    pathValidator.fixDomainTable(); 
    
    // Validate domain table:
    var pathValidator = new GlideDomainPathValidator();
    pathValidator.setUpdateProgress(false);
    pathValidator.checkDomainTableConsistency(false);

 

 


Related Problem: PRB1253253

Seen In

There is no data to report.

Intended Fix Version

Jakarta Patch 10
London

Fixed In

Jakarta Patch 7 Hot Fix 2
Kingston Patch 7

Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-07-01 02:33:56
Published:2018-07-01