• Steve Schreiner 4
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Trigger having all the events so in handler there are two methods which i not able to cover how to cover this methods:-

public void afterDelete(SObject so) {
    }
    
    public void afterUndelete(SObject so) {
    }
I need to write a trigger for the below requirement:

If a record is inserted in an object phone with name iphone and colour red, then trigger should insert iphone with all the availaible colour- black blue orange and so on

There were 10 colour present in as metadata with name colour, so trigger should create iphone with all the remaining colour except red.
Trigger having all the events so in handler there are two methods which i not able to cover how to cover this methods:-

public void afterDelete(SObject so) {
    }
    
    public void afterUndelete(SObject so) {
    }
Does any one have idea to compare two text fields(alphanumeric)?
My requirement is Field1 should always be lesser than Field2.

For eg.
Scenario 1: 
Field1 is ABC000 and Field 2 is XYZ000. In this case, validation will not display an error.

Scenario 2:
Field1 is XYZ000 and Field 2 is ABC000. In this case, validation will  display an error.

Scenario 3: 
Field1 is XYZ006 and Field 2 is XYZ004. In this case, validation will  display an error.

Scenario 3: 
Field1 is XZZ006 and Field 2 is XYZ004. In this case, validation will  display an error.

Thanks!