Upgrade EPC Schema

Run these jobs to upgrade the existing product data to populate new fields that support the Product Versioning feature. The Product Versioning feature tracks versions of products, picklists, and object types. These fields must be populated and maintained regardless of whether Versioning is enabled.

Important
Important

Ensure the Populate New Fields job is completed successfully before running the Populate Product Hierarchy Group Key Path job.

Populate New Fields

Populates new fields on all existing record types for the listed objects.

Note
Note

Before running this job, deactivate flows for custom record types to avoid interference with the update. See Deactivate a Flow in Flow Management and Vlocity Triggers. Active them again after the job completes.

Applies to

Upgrades from ​Salesforce Industries Communications, Media, and Energy Spring '20

Apex Name

VersioningUpgradeBatchJob

Where to Run this Job

Upgrade Jobs in the Admin Console section on the CMT Administration tab.

Risks of Running This Job

Low Risk. These fields are populated only when they are null, so if you run this job again, it does not modify existing field values.

By default, this job processes all products, including those that are not in the Vlocity catalog. While there is no risk to the non-Vlocity products, processing these products adds to the time to deploy.

When Not to Run This Job

Do not run this job for product configuration that is not managed directly in Enterprise Product Catalog (EPC).

When to Run This Job

  • Run this job once during the upgrade process for existing product data.

  • Run this job for products imported from external sources.

  • Re-run this job for products imported from external sources after the initial run.

  • If you create entries in Vlocity Product Console, run this job again before updating to Vlocity Product Designer.

More Information

This batch job is used for the following versioned objects:

  • Product2

    • Populates GlobalGroupKey__c with auto-generated GUID.

    • Sets the Version Label field if you provide it. The default value is V1.0.

  • Object Type

    • Populates GlobalGroupKey__c with an auto-generated GUID.

    • Sets the Version Label if you provide it. The default value is V1.0.

  • Picklist

    • Populates GlobalGroupKey__c with an auto-generated GUID.

    • Sets the Version Label field if you provide it. The default value is V1.0.

If you do not want to update custom record types, use the following steps to run the job from the Developer Console.

  1. From Setup, choose Developer Console.

  2. From the Debug menu, choose Open Execute Anonymous Window.

  3. Paste the following statement into the Enter Apex Code dialog box, replacing namespace with the namespace for your org:

    // initiate the batch process
    String parameters = '{"methodName":"startVersioningUpgradeBatchJob","objectString":"Product2","versionLabel":"V1","lifecycleStatus":null,"versionUpgradeJobBatchSize":200,"objectFiltersListString":"RecordTypeId NOT IN (\'abcde\',\'fghij\',\'klmno\')"}';
    vlocity_cmt.TelcoAdminConsoleController consoleController = new vlocity_cmt.TelcoAdminConsoleController();
    consoleController.setParameters(parameters);
    consoleController.invokeMethod();
    
    // update the Installation Assistant step
    AsyncApexJob batchJob = [SELECT Id, CreatedDate FROM AsyncApexJob WHERE ApexClass.Name = 'VersioningUpgradeBatchJob' ORDER BY CreatedDate DESC LIMIT 1];
    List<UpgradeStep__c> steps = [SELECT Id, Name FROM UpgradeStep__c WHERE Name = 'Populate New Fields for Product2' LIMIT 1];
    if(steps.isEmpty()) return;
    steps[0].LastCheckStatus__c = 'Complete';
    steps[0].LastExecutionDateTime__c = batchJob.CreatedDate;
    steps[0].LastExecutionStatus__c = 'Complete';
    update steps;
  4. Select the statement.

  5. Click Execute Highlighted.

  6. Close Developer Console.

Populate Product Hierarchy Group Key Path

Populates product group keys and product hierarchy group key path fields for existing records.

Applies to

Upgrades from ​Salesforce Industries Communications, Media, and Energy Spring '20

Apex Name

PopulateVlocityAttachmentProdGrpKeyJob and PopulateProdHierarchyGrpKeyPathJob

Where to Run this Job

Upgrade Jobs in the Admin Console section on the CMT Administration tab.

Risks of Running This Job

Low Risk

When Not to Run This Job

Do not run this job for product configuration managed directly in EPC.

When to Run This Job

  • Run this job once during the upgrade process for existing product data.

  • Run this job for products imported from external sources.

  • Re-run this job for products imported from external sources after the initial run.

  • If you create entries in Vlocity Product Console, run this job again before updating to Vlocity Product Designer.

More Information

This job populates product global group key references on related objects, mainly ProductHierarchyGroupKeyPath__c, in the following objects:

  • Opportunity Line Item

  • Quote Line Item

  • Order Item

  • Asset

  • Promotions Item

  • Override Definition

  • Vlocity Attachment

ProductHierarchyPath__c stores the hierarchy path using Product2.Id, whereas ProductHierarchyGroupKeyPath__c stores the hierarchy path using Product2.GlobalGroupKey__c.