Executing Trigger based on field value in Salesforce

Executing Trigger based on field value in Salesforce

Sample Trigger:

 trigger test on Member__c (after insert)
{
    List<Case> cases = new List<Case>();

    for(Member__c mem:Trigger.new)
    {
        if(
mem.Comments__c != null || mem.Comments__c != ”)
        {
                Case newCase = new Case(subject=’Material’,Status=’New’,Origin=’Web’);           
                insert newCase;

        }
    }

}

Leave a Reply