• Ivan Grgurina
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hi All,
I am newbiee to Salesforce.I have two Objects Case and a custom Object CaseReplica.On Case Replica I have a custom Field Total Cases.What I want to do is count Total number of cases created in a day  and save that number in field Total Cases in CaseReplica.One Record For a day should be created in CaseReplica.Please suggest me methods to do it.
Thanks in advance 

Hi,

 

- Sorry to bother, but I found no answer to this wuestion either on the web, or in the dev forum, or in the Apex documentation - 

 

I have a trigger, which detects error conditions and feeds errors to the class or field.

This gives a nice result interactively, in the GUI.

But how do I write test code to catch these errors ?  Is there a System.AssertException(), or the equivalent ? 

 

trigger createOrder on Asset (after insert, after update) {[...] if (price.get(a.Product2Id) == NULL) { System.debug(' error : no active price'); a.Product2Id.addError('no active price on the Product'); }[...]}

 

 

 

  • August 31, 2009
  • Like
  • 1