• Shawn C King
  • NEWBIE
  • 25 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 13
    Replies

I getting this error:

 

CreateTaskonCloseofDateEscrow45DayCall: execution of AfterUpdate  caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filterin

 

on a SOQL trigger where I use this statement:

List<BeazerLot__c> ownerid = [SELECT OwnerId FROM BeazerLot__c WHERE DefaultCaseOwner__c =: defaultcaseowner AND AddressLine1__c =: address LIMIT 1];

 

I'm new to SalesForce can someone help me with this error

 

 

Does anyone know why an Activity is not showing up when I edit my BeazerLot__c object although I have made the following trigger code:

 

trigger CreateTaskonCloseofDateEscrow45DayCall on BeazerLot__c (after update) {


BeazerLot__c b = new BeazerLot__c ();


Task t = new Task();
t.OwnerID = trigger.new[0].Ownerid; //trigger.new[0].DefaultCaseOwner__c;
t.Subject = '45 Day Call';

insert t;

}

Can someone help me with the syntax that if the Service Type on all of the Service Items on a Case is equal to a value (i.e. "Not Warranted").  I have a Case object and a child object called ServiceItem_Summary (which i believe combines all service items on a case). The syntax will be written in a workflow rule.  I am new to Salesforce and any help would be appreciated

I am getting the error below when I try to validate my changeset.  Below that is the test method... Can some point me in the right direction?

 

Test_CC_BeazerLot_TriggerMethods.testHandleOwnerChange() Class 177 1 Failure Message: "System.DmlException: Update failed. First exception on row 0 with id a0iC0000005ies8IAA; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, BeazerLot_Close: execution of AfterUpdate caused by: System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Owner ID: owne...

 

private static testMethod void test_handleLotClosure() {

// Create test account with co buyer info
Account acc1 = new Account(lastname='ACC1LAST', firstname='ACC1FIRST', personEmail='test@test.test', CoBuyerLastName__c = 'CB1LAST', CoBuyerFirstName__c = 'CB1FIRST', recordTypeID = CC_BeazerLot_TriggerMethods.PERSON_RECORD_TYPE, cobuyerEmail__c = 'test@test.test');
insert acc1;

CoContact__c cc1 = new CoContact__c(CoContactAccount__c = acc1.id, CoContactfirstname__c = 'CC1FIRST', CoContactlastname__c='CC1LAST', CoContactemail__c = 'test@test.com');
insert cc1;

CoContact__c cc2 = new CoContact__c(CoContactAccount__c = acc1.id, CoContactfirstname__c = 'CC2FIRST', CoContactlastname__c='CC2LAST', CoContactemail__c = 'test@test.com');
insert cc2;

// Create test lot, referencing the above account, but is not closed
BeazerLot__c lot1 = new BeazerLot__c(name='0054', status__c = 'Spec House', accountname__c = acc1.id);
insert lot1;

// Ensure no lot relationships were created
List<CC_LotRelationship__c> lot1Rels = [SELECT id, accountname__c FROM cc_lotrelationship__c WHERE BeazerLot__c = :lot1.id];
System.assertEquals(0, lot1Rels.size());

Test.startTest();

lot1.status__c = 'Closed';
update lot1;

Test.stopTest();

// Should now have 4 lot relationships
lot1Rels = [SELECT id, accountname__c, accountname__r.firstname, accountname__r.lastname, NHCCContactPriority__c FROM cc_lotrelationship__c WHERE BeazerLot__c = :lot1.id];
System.assertEquals(4, lot1Rels.size());

lot1 = [SELECT id, accountname__c, accountname__r.cobuyerlastname__c, accountname__r.cobuyerfirstname__c, keycontact1name__c, keycontact1name__r.accountname__c, keycontact2name__c, keycontact2name__r.accountname__r.firstname, keycontact2name__r.accountname__r.lastname FROM BeazerLot__c WHERE id = :lot1.id];

// Assert that the KeyContact1 and KeyContact2 fields have been populated correctly
for (CC_LotRelationship__c loopLR : lot1Rels) {
if (loopLR.NHCCContactPriority__c == CC_BeazerLot_TriggerMethods.KEY_CONTACT_1 ) {
System.assertEquals(lot1.keycontact1name__c, loopLR.id);
}
if (loopLR.NHCCContactPriority__c == CC_BeazerLot_TriggerMethods.KEY_CONTACT_2 ) {
System.assertEquals(lot1.keycontact2name__c, loopLR.id);
}

}

// Assert that the account names are correct
System.assertEquals(lot1.accountname__c, lot1.keycontact1name__r.accountname__c);
System.assertEquals(lot1.accountname__r.cobuyerlastname__c , lot1.keycontact2name__r.accountname__r.lastname);
System.assertEquals(lot1.accountname__r.cobuyerfirstname__c, lot1.keycontact2name__r.accountname__r.firstname);

}

 

Does anyone know why an Activity is not showing up when I edit my BeazerLot__c object although I have made the following trigger code:

 

trigger CreateTaskonCloseofDateEscrow45DayCall on BeazerLot__c (after update) {


BeazerLot__c b = new BeazerLot__c ();


Task t = new Task();
t.OwnerID = trigger.new[0].Ownerid; //trigger.new[0].DefaultCaseOwner__c;
t.Subject = '45 Day Call';

insert t;

}

Can someone help me with the syntax that if the Service Type on all of the Service Items on a Case is equal to a value (i.e. "Not Warranted").  I have a Case object and a child object called ServiceItem_Summary (which i believe combines all service items on a case). The syntax will be written in a workflow rule.  I am new to Salesforce and any help would be appreciated

I am getting the error below when I try to validate my changeset.  Below that is the test method... Can some point me in the right direction?

 

Test_CC_BeazerLot_TriggerMethods.testHandleOwnerChange() Class 177 1 Failure Message: "System.DmlException: Update failed. First exception on row 0 with id a0iC0000005ies8IAA; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, BeazerLot_Close: execution of AfterUpdate caused by: System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Owner ID: owne...

 

private static testMethod void test_handleLotClosure() {

// Create test account with co buyer info
Account acc1 = new Account(lastname='ACC1LAST', firstname='ACC1FIRST', personEmail='test@test.test', CoBuyerLastName__c = 'CB1LAST', CoBuyerFirstName__c = 'CB1FIRST', recordTypeID = CC_BeazerLot_TriggerMethods.PERSON_RECORD_TYPE, cobuyerEmail__c = 'test@test.test');
insert acc1;

CoContact__c cc1 = new CoContact__c(CoContactAccount__c = acc1.id, CoContactfirstname__c = 'CC1FIRST', CoContactlastname__c='CC1LAST', CoContactemail__c = 'test@test.com');
insert cc1;

CoContact__c cc2 = new CoContact__c(CoContactAccount__c = acc1.id, CoContactfirstname__c = 'CC2FIRST', CoContactlastname__c='CC2LAST', CoContactemail__c = 'test@test.com');
insert cc2;

// Create test lot, referencing the above account, but is not closed
BeazerLot__c lot1 = new BeazerLot__c(name='0054', status__c = 'Spec House', accountname__c = acc1.id);
insert lot1;

// Ensure no lot relationships were created
List<CC_LotRelationship__c> lot1Rels = [SELECT id, accountname__c FROM cc_lotrelationship__c WHERE BeazerLot__c = :lot1.id];
System.assertEquals(0, lot1Rels.size());

Test.startTest();

lot1.status__c = 'Closed';
update lot1;

Test.stopTest();

// Should now have 4 lot relationships
lot1Rels = [SELECT id, accountname__c, accountname__r.firstname, accountname__r.lastname, NHCCContactPriority__c FROM cc_lotrelationship__c WHERE BeazerLot__c = :lot1.id];
System.assertEquals(4, lot1Rels.size());

lot1 = [SELECT id, accountname__c, accountname__r.cobuyerlastname__c, accountname__r.cobuyerfirstname__c, keycontact1name__c, keycontact1name__r.accountname__c, keycontact2name__c, keycontact2name__r.accountname__r.firstname, keycontact2name__r.accountname__r.lastname FROM BeazerLot__c WHERE id = :lot1.id];

// Assert that the KeyContact1 and KeyContact2 fields have been populated correctly
for (CC_LotRelationship__c loopLR : lot1Rels) {
if (loopLR.NHCCContactPriority__c == CC_BeazerLot_TriggerMethods.KEY_CONTACT_1 ) {
System.assertEquals(lot1.keycontact1name__c, loopLR.id);
}
if (loopLR.NHCCContactPriority__c == CC_BeazerLot_TriggerMethods.KEY_CONTACT_2 ) {
System.assertEquals(lot1.keycontact2name__c, loopLR.id);
}

}

// Assert that the account names are correct
System.assertEquals(lot1.accountname__c, lot1.keycontact1name__r.accountname__c);
System.assertEquals(lot1.accountname__r.cobuyerlastname__c , lot1.keycontact2name__r.accountname__r.lastname);
System.assertEquals(lot1.accountname__r.cobuyerfirstname__c, lot1.keycontact2name__r.accountname__r.firstname);

}