public Boolean mapContains(Map<id,Object> searchObj, String searchKey, String searchVal){
for (ID idKey : searchObj.keyset()) {
System.debug(searchObj.get(idKey).get(searchKey));
if( searchObj.get(idKey).get(searchKey) == searchVal) {
System.debug('Match Found'+ searchObj.get(idKey));
return true;
}else{
System.debug('No Match');
}
}
return false;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter