• Nick Joseph
  • NEWBIE
  • 0 Points
  • Member since 2014
  • Data Integration Specialist
  • nCino, LLC


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
I've scoured the forums. Is it possible to leverage the Schedulable Inteface to schedule a REST Post callout every 30 minutes? I found a related article saying this was not supported, but its from 2010: https://developer.salesforce.com/forums/?id=906F0000000BLRzIAO#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=906F00000008xKiIAI
Getting a Null Pointer exception with this quick Post code:
 
trigger CallInformaticaTaskFlow on Informatica_Cloud_Integration__c (After Update) {
    for (Informatica_Cloud_Integration__c settingRecord: Trigger.new) {
        If(settingRecord.Monitor__c == TRUE && Trigger.oldMap.get(settingRecord.Id).Monitor__c==FALSE){
            InformaticaTaskFlow.runJob(settingRecord.Informatica_Cloud_Username__c, settingRecord.Informatica_Cloud_Password__c, settingRecord.Monitoring_Task_Flow__c,'Workflow');
        }
    }
}

Test:
@isTest
public class CallInformaticaTaskFlowTest {
    public static testmethod void InformaticaTriggerTest() {
        Informatica_Cloud_Integration__c infa = new Informatica_Cloud_Integration__c();
        infa.Informatica_Cloud_Username__c = 'test@ncino.com';
        infa.Informatica_Cloud_Password__c = 'O4m27iCX72F6!';
        infa.Task_Flow_to_Monitor__c = 'Test_Bank_C000001_Daily_TaskFlow_Production';
        infa.Exception_Retention__c = 0;
        infa.Monitor_Retention__c = 0;
        insert infa;
        infa.Monitor__c=TRUE;
        update infa;
    }    
    
    

}

 
All,

I've reviewed several examples and cannot get any to work for me. Here is Controller, complete with Test Class. Any advice for how to get my Catch Block covered in this scenario.
 
public class EscalateToDataController {
    
    private final Case datacase;
    private final Case supportcase;
    private String datacaseURL;
    private String supportcaseURL;
    
    public EscalateToDataController() {
        datacase = [SELECT ID, Subject, Recently_Escalated__c, Escalated_To_Data__c, Reverted__c, Type, OwnerID, Data_Case_Description__c, Status, Description, Priority, Severity__c,Primary_Case_Team_Member__c FROM Case WHERE Recently_Escalated__c = TRUE AND (Escalated_To_Data__c = TRUE OR Reverted__c = TRUE)];
        try {
        supportcase = [SELECT ID, Subject, Recently_Escalated__c, Escalated_To_Data__c, Reverted__c,Type, OwnerID, Description, Status, Priority, Severity__c, Data_Case_Description__c,Primary_Case_Team_Member__c  FROM Case WHERE Recently_Escalated__c = TRUE AND Status = 'New'];
        } catch (Exception ex) {
            supportcase = null;
        }
        datacaseURL = URL.getSalesforceBaseUrl().toExternalForm() + '/' + datacase.Id;
        if (supportcase != null) supportcaseURL = URL.getSalesforceBaseUrl().toExternalForm() + '/' + supportcase.Id;
    }
    
    public Case getDataCase() {
        return datacase;
    }
    
    public Case getSupportCase() {
        return supportcase;
    }
    
    public String getDataCaseURL() {
        return datacaseURL;
    }
    
    public String getSupportCaseURL() {
        return supportcaseURL;
    }      
    
    public void resetCases() {
        List<Case> casesToReset = new List<Case>();
        datacase.Recently_Escalated__c=FALSE;
        datacase.Reverted__c=FALSE;
        if(supportcase != null) {
            supportcase.Recently_Escalated__c=FALSE;
            casesToReset.add(supportcase);
        }
        casesToReset.add(datacase);
        update casesToReset;
                
    }
}
 
@isTest
public class EscalateToDataControllerTest {
    public static testMethod void testController() {
        
        List<Case> caseList = new List<Case>();
        User testOwner = [SELECT ID FROM User WHERE Controls_Data_Case_Queue__c=TRUE];
        if (testOwner.ID==NULL) {
            testOwner = [SELECT ID FROM User WHERE Alias='Nick'];
        }
        String testOwnerID = testOwner.ID;
        String dataURL;
        String supportURL;
        Case testDataCase = New Case (
            Subject = 'Test Subject',
            Type = 'Escalated',
            Recently_Escalated__c = TRUE,
            Escalated_To_Data__c = TRUE,
            OwnerID = testOwnerID,
            Data_Case_Description__c = 'Test',
            Reverted__c = FALSE,
            Description = 'Test',
            Priority = 'High',
            Severity__c = 'Urgent',
            Status = 'Escalated - Data',
            Primary_Case_Team_Member__c = '0051400000Bogfv'
        );insert testDataCase; caseList.add(testDataCase);
        Case testSupportCase = New Case (
            Subject = 'Test Subject2',
            Type = 'Question',
            Recently_Escalated__c = TRUE,
            Reverted__c = FALSE,
            Escalated_To_Data__c = FALSE,
            OwnerID = testOwnerID,
            Data_Case_Description__c = 'Test2',
            Description = 'Test2',
            Priority = 'High',
            Primary_Case_Team_Member__c = '0051400000Bogfv',
            Severity__c = 'Urgent',
            Status = 'New'
        );insert testSupportCase; caseList.add(testSupportCase);
        Case testControlCase = New Case (
            Subject = 'Test Subject2',
            Type = 'Configuration Change',
            Recently_Escalated__c = FALSE,
            Escalated_To_Data__c = FALSE,
            Reverted__c = FALSE,
            OwnerID = testOwnerID,
            Data_Case_Description__c = 'Test2',
            Primary_Case_Team_Member__c = '0051400000Bogfv',
            Description = 'Test2',
            Priority = 'High',
            Severity__c = 'Urgent',
            Status = 'In Progress'
        );insert testControlCase; caseList.add(testControlCase);
        
        EscalateToDataController controller = new EscalateToDataController();
        controller.getDataCase();
        controller.getSupportCase();
        dataURL = controller.getDataCaseURL();
        supportURL = controller.getSupportCaseURL();
        
        PageReference ref = new PageReference('/apex/EscalateToDataFinish');
        System.assertEquals(testDataCase, controller.getDataCase()); 
        System.assertEquals(testSupportCase, controller.getSupportCase());
        System.assertEquals(dataURL, controller.getDataCaseURL());
        System.assertEquals(supportURL, controller.getSupportCaseURL());
        Test.startTest();
            List<Case> newCaseList = new List<Case>();
            controller.resetCases();
        	newCaseList = [SELECT ID, Recently_Escalated__c, Reverted__c FROM CASE WHERE Recently_Escalated__c=TRUE OR Reverted__c = TRUE];
        	System.assertEquals(0, newCaseList.size());
        Test.stopTest();        
        
    }
    
}

 
Hello all,

Is there a way to edit the style of a Visual Flow, such that I can style the Output Text? I have read this article: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_flows_customize_runtime_ui.htm

no help there. Here is some code, as you can see I was testing styling certain components of the flow, no luck with the output text
<apex:page standardController="case" tabStyle="case" title="Escalate Case to Data Team" standardStylesheets="False">
        <style type="text/css">
            .OutputText {
                color: blue;
            }
            .FlowContainer {
                color: blue;
            }
            .FlowTextArea {
                color: green;
            }
            .FlowText {
                color: red;
            }
            .Text {
                color: blue;
            }
        </style>
            <flow:interview name="Data_Escalation" finishLocation="{!$Page.EscalateToDataFinish}" >
                <apex:param name="CaseID" value="{!Case.Id}"/>
            </flow:interview>>
</apex:page>
I have searched the formus and found several examples of Test Coverage for Catch blocks, however I have no been able to implement a solution that successfully covers it. Here is a quick code snippet of the Try/Catch from the Controller:

datacase = [SELECT ID, Subject, Recently_Escalated__c, Type, OwnerID, Data_Case_Description__c, Status, Description, Priority, Severity__c FROM Case WHERE Recently_Escalated__c = TRUE AND Type = 'Escalated'];
        try {
        supportcase = [SELECT ID, Subject, Recently_Escalated__c, Type, OwnerID, Description, Status, Priority, Severity__c, Data_Case_Description__c  FROM Case WHERE Recently_Escalated__c = TRUE AND Status = 'New'];
        } catch (Exception ex) {
            supportcase = null;

Test Class snippet:
 Case testSupportCase = New Case (
            Subject = 'Test Subject2',
            Type = 'Question',
            Recently_Escalated__c = TRUE,
            OwnerID = testOwnerID,
            Data_Case_Description__c = 'Test2',
            Description = 'Test2',
            Priority = 'High',
            Severity__c = 'Urgent',
            Status = 'New'

 Test.startTest();
            List<Case> newCaseList = new List<Case>();
            controller.resetCases();
            newCaseList = [SELECT ID, Recently_Escalated__c FROM CASE WHERE Recently_Escalated__c=TRUE];
            delete testSupportCase;
            controller.getSupportCase();
        Test.stopTest();  
Getting a Null Pointer exception with this quick Post code:
 
trigger CallInformaticaTaskFlow on Informatica_Cloud_Integration__c (After Update) {
    for (Informatica_Cloud_Integration__c settingRecord: Trigger.new) {
        If(settingRecord.Monitor__c == TRUE && Trigger.oldMap.get(settingRecord.Id).Monitor__c==FALSE){
            InformaticaTaskFlow.runJob(settingRecord.Informatica_Cloud_Username__c, settingRecord.Informatica_Cloud_Password__c, settingRecord.Monitoring_Task_Flow__c,'Workflow');
        }
    }
}

Test:
@isTest
public class CallInformaticaTaskFlowTest {
    public static testmethod void InformaticaTriggerTest() {
        Informatica_Cloud_Integration__c infa = new Informatica_Cloud_Integration__c();
        infa.Informatica_Cloud_Username__c = 'test@ncino.com';
        infa.Informatica_Cloud_Password__c = 'O4m27iCX72F6!';
        infa.Task_Flow_to_Monitor__c = 'Test_Bank_C000001_Daily_TaskFlow_Production';
        infa.Exception_Retention__c = 0;
        infa.Monitor_Retention__c = 0;
        insert infa;
        infa.Monitor__c=TRUE;
        update infa;
    }    
    
    

}

 
All,

I've reviewed several examples and cannot get any to work for me. Here is Controller, complete with Test Class. Any advice for how to get my Catch Block covered in this scenario.
 
public class EscalateToDataController {
    
    private final Case datacase;
    private final Case supportcase;
    private String datacaseURL;
    private String supportcaseURL;
    
    public EscalateToDataController() {
        datacase = [SELECT ID, Subject, Recently_Escalated__c, Escalated_To_Data__c, Reverted__c, Type, OwnerID, Data_Case_Description__c, Status, Description, Priority, Severity__c,Primary_Case_Team_Member__c FROM Case WHERE Recently_Escalated__c = TRUE AND (Escalated_To_Data__c = TRUE OR Reverted__c = TRUE)];
        try {
        supportcase = [SELECT ID, Subject, Recently_Escalated__c, Escalated_To_Data__c, Reverted__c,Type, OwnerID, Description, Status, Priority, Severity__c, Data_Case_Description__c,Primary_Case_Team_Member__c  FROM Case WHERE Recently_Escalated__c = TRUE AND Status = 'New'];
        } catch (Exception ex) {
            supportcase = null;
        }
        datacaseURL = URL.getSalesforceBaseUrl().toExternalForm() + '/' + datacase.Id;
        if (supportcase != null) supportcaseURL = URL.getSalesforceBaseUrl().toExternalForm() + '/' + supportcase.Id;
    }
    
    public Case getDataCase() {
        return datacase;
    }
    
    public Case getSupportCase() {
        return supportcase;
    }
    
    public String getDataCaseURL() {
        return datacaseURL;
    }
    
    public String getSupportCaseURL() {
        return supportcaseURL;
    }      
    
    public void resetCases() {
        List<Case> casesToReset = new List<Case>();
        datacase.Recently_Escalated__c=FALSE;
        datacase.Reverted__c=FALSE;
        if(supportcase != null) {
            supportcase.Recently_Escalated__c=FALSE;
            casesToReset.add(supportcase);
        }
        casesToReset.add(datacase);
        update casesToReset;
                
    }
}
 
@isTest
public class EscalateToDataControllerTest {
    public static testMethod void testController() {
        
        List<Case> caseList = new List<Case>();
        User testOwner = [SELECT ID FROM User WHERE Controls_Data_Case_Queue__c=TRUE];
        if (testOwner.ID==NULL) {
            testOwner = [SELECT ID FROM User WHERE Alias='Nick'];
        }
        String testOwnerID = testOwner.ID;
        String dataURL;
        String supportURL;
        Case testDataCase = New Case (
            Subject = 'Test Subject',
            Type = 'Escalated',
            Recently_Escalated__c = TRUE,
            Escalated_To_Data__c = TRUE,
            OwnerID = testOwnerID,
            Data_Case_Description__c = 'Test',
            Reverted__c = FALSE,
            Description = 'Test',
            Priority = 'High',
            Severity__c = 'Urgent',
            Status = 'Escalated - Data',
            Primary_Case_Team_Member__c = '0051400000Bogfv'
        );insert testDataCase; caseList.add(testDataCase);
        Case testSupportCase = New Case (
            Subject = 'Test Subject2',
            Type = 'Question',
            Recently_Escalated__c = TRUE,
            Reverted__c = FALSE,
            Escalated_To_Data__c = FALSE,
            OwnerID = testOwnerID,
            Data_Case_Description__c = 'Test2',
            Description = 'Test2',
            Priority = 'High',
            Primary_Case_Team_Member__c = '0051400000Bogfv',
            Severity__c = 'Urgent',
            Status = 'New'
        );insert testSupportCase; caseList.add(testSupportCase);
        Case testControlCase = New Case (
            Subject = 'Test Subject2',
            Type = 'Configuration Change',
            Recently_Escalated__c = FALSE,
            Escalated_To_Data__c = FALSE,
            Reverted__c = FALSE,
            OwnerID = testOwnerID,
            Data_Case_Description__c = 'Test2',
            Primary_Case_Team_Member__c = '0051400000Bogfv',
            Description = 'Test2',
            Priority = 'High',
            Severity__c = 'Urgent',
            Status = 'In Progress'
        );insert testControlCase; caseList.add(testControlCase);
        
        EscalateToDataController controller = new EscalateToDataController();
        controller.getDataCase();
        controller.getSupportCase();
        dataURL = controller.getDataCaseURL();
        supportURL = controller.getSupportCaseURL();
        
        PageReference ref = new PageReference('/apex/EscalateToDataFinish');
        System.assertEquals(testDataCase, controller.getDataCase()); 
        System.assertEquals(testSupportCase, controller.getSupportCase());
        System.assertEquals(dataURL, controller.getDataCaseURL());
        System.assertEquals(supportURL, controller.getSupportCaseURL());
        Test.startTest();
            List<Case> newCaseList = new List<Case>();
            controller.resetCases();
        	newCaseList = [SELECT ID, Recently_Escalated__c, Reverted__c FROM CASE WHERE Recently_Escalated__c=TRUE OR Reverted__c = TRUE];
        	System.assertEquals(0, newCaseList.size());
        Test.stopTest();        
        
    }
    
}

 
Hello all,

Is there a way to edit the style of a Visual Flow, such that I can style the Output Text? I have read this article: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_flows_customize_runtime_ui.htm

no help there. Here is some code, as you can see I was testing styling certain components of the flow, no luck with the output text
<apex:page standardController="case" tabStyle="case" title="Escalate Case to Data Team" standardStylesheets="False">
        <style type="text/css">
            .OutputText {
                color: blue;
            }
            .FlowContainer {
                color: blue;
            }
            .FlowTextArea {
                color: green;
            }
            .FlowText {
                color: red;
            }
            .Text {
                color: blue;
            }
        </style>
            <flow:interview name="Data_Escalation" finishLocation="{!$Page.EscalateToDataFinish}" >
                <apex:param name="CaseID" value="{!Case.Id}"/>
            </flow:interview>>
</apex:page>