• tonyvia27
  • NEWBIE
  • 10 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies
Help: I have created a Validation which will block the insertion of a contact if the contact is related to an account and has a mailing postal code (which has the API Name MailingPostalCode) different from the account's shipping postal code (which has the API Name ShippingPostalCode).
I tested the validation and I know it works because it gives the correct error message for this scenario however I am recieiving this error from Trail Head when I click on the green Check Challenge button :

There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: STORAGE_LIMIT_EXCEEDED, storage limit exceeded: []

2) I checked Data Management and I have a lot of space for creating a contact (1% or 99% free space)
For accounts I am at 93% full but I am not creating another account.

IS it the account percentage that needs reducing even though I am not creating another Account obejct at 93%?  Thanks for your help on this.
Help: I have created a Validation which will block the insertion of a contact if the contact is related to an account and has a mailing postal code (which has the API Name MailingPostalCode) different from the account's shipping postal code (which has the API Name ShippingPostalCode).
I tested the validation and I know it works because it gives the correct error message for this scenario however I am recieiving this error from Trail Head when I click on the green Check Challenge button :

There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: STORAGE_LIMIT_EXCEEDED, storage limit exceeded: []

2) I checked Data Management and I have a lot of space for creating a contact (1% or 99% free space)
For accounts I am at 93% full but I am not creating another account.

IS it the account percentage that needs reducing even though I am not creating another Account obejct at 93%?  Thanks for your help on this.

Hi All,

 

This is my trigger

 

trigger ETicketAirlineUrlTrigger on E_Ticket__c (after insert, after update) {
 
    List<E_Ticket__c> listEt = new List<E_Ticket__c>();
      for(E_Ticket__c et : Trigger.New)
      {
          E_Ticket__c etNew = [SELECT Id,Airline__c FROM E_Ticket__c WHERE Id =:et.id];
          if(etNew.Airline__c =='Virgin Australia')
          {    
            etNew.Airlines_Url__c = '<a href="http://www.virginaustralia.com/Personal/Bookings/Managebookings/index.htm">Virgin Australia</a>';
          }
          else if(etNew.Airline__c =='Virgin Atlantic')
          {
            etNew.Airlines_Url__c = '<a href="https://www.virgin-atlantic.com/en/us/manageyourflights/updatebooking/index.jsp">Virgin Atlantic</a>';
          }
          listEt.add(etNew);
      }
      if(listEt.size()>0)
      update listEt;
}

 

And test case is

 

@isTest
private class ETicketAirlineUrlTestCase {

    static testMethod void myUnitTest() {
        Opportunity oppNew =  new Opportunity();
        oppNew.Name = 'Test Opp';
        oppNew.StageName = 'To Be Searched';
        oppNew.CloseDate = System.now().date();
        insert oppNew;
        
        E_Ticket__c et =  new E_Ticket__c();
        et.Airline__c = 'Virgin Australia';
        et.Opportunity__c = oppNew.Id;
        insert et;
        
        List<E_Ticket__c> listEt = new List<E_Ticket__c>();
        
        E_Ticket__c etOld = [SELECT Id,Airline__c FROM E_Ticket__c WHERE Id =:et.Id];
        etOld.Airline__c = 'Virgin Atlantic';
        listEt.add(etOld);
        if (listEt != null && !listEt.isEmpty())
          {
             Database.update(listEt);
          }
    }
}

 

Getting following error

 


System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ETicketAirlineUrlTrigger: execution of AfterInsert

 

What is wrong here?

Thanks

hi

 

can anybody help me to write Test class for this Trigger

 

 

 

trigger insertIntoCustomerContactDetail on Contact (after insert)

{

 

for (Contact a : Trigger.new)

{

CustomerContactDetail__c ccd = new CustomerContactDetail__c

(

Contact__c = a.id,

First_Name__c =a.firstName,

Last_Name__c=a.lastName,

Date_Of_Birth__c = a.Date_Of_Birth__c,

Mobile_No__c = a.MobilePhone,

Email__c = a.Email__c

);

insert ccd ;

}

}

 

Thanks in Advance

 

Madhulendra