2

I need some help

I have an apex class which needs amending so it works on more than one criteria. Currently the class works if “Type” Contains the word “Meeting”. But I also need it to include the following;

Call – outbound Call – inbound Other - see subject

{
        System.debug('##### task type is : ' + this.thisTask.Type);
        if (this.thisTask.Type != null && this.thisTask.Type.containsIgnoreCase('Meeting')) // per requirements, the subject should contain meeting for attendees to be added to a task
            return true;
        else
            return false;
    } 

Can anyone help me with this ?

4

This is one of the way I can think of, Declare this set (validTypeSet ) at the top of the method.

Set<String> validTypeSet = new Set<String>();
validTypeSet.add('Meeting');
validTypeSet.add('Call – outbound');
validTypeSet.add('Call – inbound');
validTypeSet.add('Other - see subject');

System.debug('##### task type is : ' + this.thisTask.Type);
    if (this.thisTask.Type != null && validTypeSet.containsIgnoreCase(this.thisTask.Type)) // per requirements, the subject should contain meeting for attendees to be added to a task
        return true;
    else
        return false;
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.