You need to sign in to do that
Don't have an account?
Karthi Xavi
Comparing a text with a attachment body
Hi,
I want to compare a text with a attachment that is added to a custom object ex: Word "Test" has to checked whether it is placed in the attachment body. using apex I want to check it using apex, Kindly help me with it.
Thanks,
karthi,
I want to compare a text with a attachment that is added to a custom object ex: Word "Test" has to checked whether it is placed in the attachment body. using apex I want to check it using apex, Kindly help me with it.
Thanks,
karthi,
You can use Blob.toString() method to convert the Attachment body to string and then do comparison:
Blob body = objAttachment.Body;
if(boby.toString() == 'test')
//execute the block