Manually Creating Product Groupings (Competitive vs Complementary)

Last updated: December 6, 2025

This articles outlines the manual steps required to label HG technographics with custom values, and to populate those product installs into custom fields.

The following guide uses sample files and product values.  Please remember to change these names while building your own version.

1. Create a picklist field with two values on the Technographic object named TechType__c

2. Create two new fields on Account object named Competitor_Tech_Products__c and Complementary_Tech_Products__c that will sum all technographic products marked accordingly.

3. Create a trigger referencing the TechType__c field

4. Create a new apex class named PopulateTechnographicRecordsBatch and paste below piece of code

5. Run this batch job to populate the TechType__c field we created on the Technographic object

6. Create a new apex class named PopulateAccountHGFieldsByConditionBatch and paste below piece of code

7. Run this batch job to populate the Competitor_Tech_Products__c and Complementary_Tech_Products__c fields we created on the Account

8. Add Competitor_Tech_Products__c and Complementary_Tech_Products__c field to a report or Account page layout and review

 

 

1. Create a picklist field with two values on the Technographic object named TechType__c

  1. Navigate to Object Manager HG Technographic Object → Fields & Relationships Tab

    Screen Shot 2024-07-23 at 6.21.07 PM.png
  2. On Fields & Relationships click New in the top right and follow the prompts

    • Data Type should be Picklist
    • Values should be Competitor and Complementary
    • Set field level permissions
    • Add to the Technographic page layout

      Screen Shot 2024-07-23 at 6.33.49 PM.png


      Screen Shot 2024-07-23 at 6.24.28 PM.png
  3. Final field should look something like this →

    Screen Shot 2024-07-23 at 6.26.45 PM.png

 

2. Create two new fields on Account object named Competitor_Tech_Products__c and Complementary_Tech_Products__c that will sum all technographic products marked accordingly.

  1. Navigate to Object Manager Account Object → Fields & Relationships Tab
  2. On Fields & Relationships click New in the top right and follow the prompts - you're going to do this twice.

    • Data Type should be Text Area(255)
    • Name one Competitor Tech Products
    • Name the other Complementary Tech Products
    • Set Field Level Security, Dynamic Forms and Pages Layouts

      Screen Shot 2024-07-23 at 6.41.11 PM.png

3. Create a trigger referencing the TechType__c field

  1. Navigate to the Developer Console

    Screen Shot 2024-07-23 at 6.47.10 PM.png
  2. FileNewApex Trigger

    Screen Shot 2024-07-23 at 6.50.40 PM.png
  3. Name this TechnographicTrigger
  4. For Object select HG_Insights__HGTechnographic__c (this is the second one, make sure you don't select the one that ends with ChangeEvent)

    Screen Shot 2024-07-23 at 6.51.09 PM.png
  5. Reference this sample code
    • This is only a sample, product names will need to be updated to match use case
    • Once new records are added, this trigger will automatically fire.  For existing records that the integration has already updated we'll need to run a batch job (next step).
    • If selecting multiple fields, you'll need to use the following syntax for that section of code:

      if (tech.HG_Insights__Product__c.contains('Amazon') || tech.HG_Insights__Product__c.contains('Amazon 2')) { 
  6. Remember to FileSave!
trigger TechographicTrigger on HG_Insights__HGTechnographic__c (before insert, before update) {

for (HG_Insights__HGTechnographic__c tech : trigger.new) {

if (tech.HG_Insights__Product__c.contains('Amazon')) {

tech.TechType__c = 'Competitor';

} else if (tech.HG_Insights__Product__c.contains('Microsoft')) {

tech.TechType__c = 'Complementary';

}

}

}

Screen Shot 2024-07-23 at 6.56.21 PM.png

 

4. Create a new apex class named PopulateTechnographicRecordsBatch and paste below piece of code

  1.  In the Developer Console, select FileNewApex Class

    Screen Shot 2024-07-24 at 9.28.41 AM.png
  2. Name the Apex Class PopulateTechnographicRecordsBatch
  3. Add the following code
  4. Remember to FileSave!
global class PopulateTechnographicRecordsBatch implements Database.Batchable, Schedulable {

global Database.QueryLocator start(Database.BatchableContext bc) {

String query = 'SELECT Id, TechType__c, HG_Insights__Product__c FROM HG_Insights__HGTechnographic__c';

return Database.getQueryLocator(query);

}

global void execute(Database.BatchableContext bc, List records){

for (HG_Insights__HGTechnographic__c tech : records) {

if (tech.HG_Insights__Product__c.contains('Amazon')) {

tech.TechType__c = 'Competitor';

} else if (tech.HG_Insights__Product__c.contains('Microsoft')) {

tech.TechType__c = 'Complementary';

}

}

update records;

}

global void finish(Database.BatchableContext bc){

// execute any post-processing operations

}



//schedulable method

global void execute(SchedulableContext sc) {

PopulateTechnographicRecordsBatch batch = new PopulateTechnographicRecordsBatch();

database.executebatch(batch);

}

}

Screen Shot 2024-07-25 at 11.20.25 AM.png

5. Run this batch job to populate the TechType__c field we created on the Technographic object

  1. In the Developer Console, select DebugOpen Execute Anonymous

    Screen Shot 2024-07-25 at 11.22.07 AM.png


  2. Add the following code

    database.executeBatch(new PopulateTechnographicRecordsBatch());
  3. Click Execute and confirm success

    Screen Shot 2024-07-25 at 11.22.55 AM.png

 

6. Create a new apex class named PopulateAccountHGFieldsByConditionBatch and paste below piece of code

  1.  In the Developer Console, select FileNewApex Class

    Screen Shot 2024-07-24 at 9.28.41 AM.png
  2. Name the Apex Class PopulateAccountHGFieldsByConditionBatch
  3. Add the following code
  4. Remember to FileSave!
global class PopulateAccountHGFieldsByConditionBatch implements Database.Batchable, Schedulable {

global Database.QueryLocator start(Database.BatchableContext bc) {

String query = 'SELECT Id, Name, Competitor_Tech_Products__c, Complementary_Tech_Products__c, (select Id, HG_Insights__Product__c, TechType__c from HG_Insights__HGTechnographicToAccount__r) FROM Account WHERE HG_Insights__HG_Match_Status__c = \'Matched\'';

return Database.getQueryLocator(query);

}

global void execute(Database.BatchableContext bc, List records){

for (Account acc : records) {

acc.Competitor_Tech_Products__c = '';

acc.Complementary_Tech_Products__c = '';

for (HG_Insights__HGTechnographic__c tech : acc.HG_Insights__HGTechnographicToAccount__r) {

if (tech.TechType__c == 'Competitor') {

acc.Competitor_Tech_Products__c += !String.isEmpty(tech.HG_Insights__Product__c) ? tech.HG_Insights__Product__c + '; ' : '';

} else if (tech.TechType__c == 'Complementary'){

acc.Complementary_Tech_Products__c += !String.isEmpty(tech.HG_Insights__Product__c) ? tech.HG_Insights__Product__c + '; ' : '';



}

}

}

update records;

}

global void finish(Database.BatchableContext bc){

// execute any post-processing operations

}



//schedulable method

global void execute(SchedulableContext sc) {

PopulateAccountHGFieldsByConditionBatch batch = new PopulateAccountHGFieldsByConditionBatch();

database.executebatch(batch);

Screen Shot 2024-07-24 at 9.54.25 AM.png

7. Run this batch job to populate the Competitor_Tech_Products__c and Complementary_Tech_Products__c fields we created on the Account

  1. In the Developer Console, select DebugOpen Execute Anonymous

    Screen Shot 2024-07-25 at 11.22.07 AM.png


  2. Add the following code

    database.executeBatch(new PopulateAccountHGFieldsByConditionBatch());
  3. Click Execute and confirm success

Screen Shot 2024-07-24 at 9.55.37 AM.png

 

8. Add Competitor_Tech_Products__c and Complementary_Tech_Products__c field to a report or Account page layout and review.  You can also view TechType__c in reporting.

Screen Shot 2024-07-25 at 11.25.47 AM.png

Screen Shot 2024-07-25 at 11.41.00 AM.png