0

I have Dupeblocker installed in one of the sandbox and in Production. Using Ant script I am pushing the metadata from Sandbox to Production I am getting following error though I am not including this trigger in my package.xml file.

System.QueryException: List has no rows for assignment to SObject 
Stack Trace: (CRMfusionDBR101) Class.DB_Custom_Case_c.testTrigger: line 7, column 1

I have Same scenario created in Production Org also. I don't know how to push my metadata. In my production org I don't have any records for this object created.

The Trigger which is created by Dupeblocker:

@isTest private without sharing class DB_Custom_Case_c
{
    @isTest (SeeAllData=true)
    private static void testTrigger()
    {
        CRMfusionDBR101.DB_Globals.triggersDisabled = true;
        sObject testData = CRMfusionDBR101.DB_TriggerHandler.createTestData( Case_Cont__c.getSObjectType() );
        Test.startTest();
        insert testData;
        update testData;
        CRMfusionDBR101.DB_Globals.generateCustomTriggerException = true;
        update testData;
        delete testData;
        Test.stopTest();
    }
}

1 Answer 1

0

It doesn't matter if you include a trigger in a deploy package. Running all tests will always include all triggers, even those in managed packages that are installed. You may want to contact CRM Fusion and see if they have a fix you can apply/new version of the package/workaround/etc.

2
  • It is a Data issue. The test class is looking for live data (SeeAllData=true). To pass this class I created a dummy record in Production (I don't know is it a best practice) and ran the validate it went through.
    – Tamil
    May 19, 2015 at 19:07
  • @Tamil I'd suggest creating the record in the test class, and changing it to SeeAllData=false. It's a Bad Idea to depend on live data (as this question clearly demonstrates).
    – sfdcfox
    May 19, 2015 at 19:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .