US English (US)
ES Spanish

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Log in
English (US)
US English (US)
ES Spanish
  • Home
  • Help & Support
  • Install RIO Education

Important setup for newly cloned sandbox and test classes

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • RIO Certification
    RIO Certification Program RIO Academy RIO Challenge RIO Recipe Training
  • Releases
    Release Notes
  • Help & Support
    Install RIO Education RIO Insights RIO Recipe Support
  • About Us
    Who is RIO Education? Start Your RIO Journey Housekeeping
  • Experience RIO in action
+ More

Table of Contents

Trigger handlers for new sandbox Test class


This article outlines the important data to be set up for:

  • a new developer sandbox.
  • developing any customization that requires test classes.


Trigger handlers for new sandbox

When a new developer sandbox is cloned from production, it only contains the setup data like custom settings and custom metadata type. The required custom object data like Trigger Handler is not included.

In order to make RIO Education work in the new sandbox, you would need to execute the following script in the developer console:

rio_ed.REDU_PostInstallation pi = new rio_ed.REDU_PostInstallation();

//setup the RIO Education settings
upsert
 pi.initRIOEdSettings(rio_ed__RIO_Education_Settings__c.getOrgDefaults());        
//setup EDA Hierarchy settings
upsert
 pi.updateEDASettings();

// Get the TDTM tokens of the existing HEDA TDTM configs:        
List<hed.TDTM_Global_API.TdtmToken> allTokens = hed.TDTM_Global_API.getTdtmConfig();
// Create all HEDA trigger handlers:        
hed.TDTM_Global_API.setTdtmConfig(allTokens, 'hed');

//disable EDA trigger handlers that replaced by RIO Education
update pi.disableEDATriggerHandlers();
//create all RIO Education related trigger handlers  
pi.createAllTriggerHandlers(); 

//create a default resource type
rio_ed__Resource_Type__c rType = new rio_ed__Resource_Type__c();        
rType.Name = 'Location';        
insert rType;



1. From the new sandbox, head to Setup > Developer Console.


2. Go to Debug > Open Execute Anonymous Window.


3. Paste this code into the window and click 'Execute'.

rio_ed.REDU_PostInstallation pi = new rio_ed.REDU_PostInstallation();
pi.createAllTriggerHandlers();




4. You may double check that the REDU trigger handlers are now in your new sandbox.




Test class

In a test class with seeAllData=false, you would need to setup the RIO Education data in the @TestSetup method:

@TestSetup    
static void makeData(){        
        rio_ed.REDU_PostInstallation pi = new rio_ed.REDU_PostInstallation();

        //setup the RIO Education settings
        upsert pi.initRIOEdSettings(rio_ed__RIO_Education_Settings__c.getOrgDefaults());
        
//setup EDA Hierarchy settings
 
       upsert pi.updateEDASettings();

        // Get the TDTM tokens of the existing HEDA TDTM configs:                
        List<hed.TDTM_Global_API.TdtmToken> allTokens = hed.TDTM_Global_API.getTdtmConfig();
        // Create all HEDA trigger handlers:        
        hed.TDTM_Global_API.setTdtmConfig(allTokens, 'hed');

        //disable EDA trigger handlers that replaced by RIO Education
 
       update pi.disableEDATriggerHandlers();        
        //create all RIO Education related trigger handlers               
        pi.createAllTriggerHandlers();

        //create a default resource type        
        rio_ed__Resource_Type__c rType = new rio_ed__Resource_Type__c();                
        rType.Name = 'Location';                
        insert rType;    
}



what data to set up for new developer sandbox what data to set up for developing customization test class how to set up rio education in new developer sandbox cloned from production

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Not using Communities? What metadata to deploy
  • Upgrading? Which metadata should be deployed
  • RIO Education Deployment Process
  • RIO Education Plans
RIO Education

RIO Education, a WDCi Company. This information is proprietary, confidential and protected by copyright ©2024.

CONTACT

Get in touch

  • Privacy
  • Terms of service

Knowledge Base Software powered by Helpjuice

Definition by Author

0
0
Expand