I have written a trigger to remove the duplicate insertions but it allows duplications   please check it once where sholu i mistaken  this is my trigger   trigger DuplicateCateCase on Case(before insert,before update) {       Set&lt;string&gt; accountname= new Set&lt;string&gt;();      Set&lt;string&gt; integrationtoo= new Set&lt;string&gt;();        for(Case cas: Trigger.new)      {        accountname.add(cas.Account.Name);        integrationtoo.add(cas.IntegrationTo__c);       }     List&lt;Case&gt; duplicatecaseList = [Select id,Case.Account.Name,IntegrationTo__c,SFType__c From Case where Case.Account.Name= :accountname AND IntegrationTo__c =:integrationtoo];     Set&lt;string &gt; duplicatecaseIds = new Set&lt;string &gt;();     for(Case dup: duplicatecaseList )    {      duplicatecaseIds .add(dup.Account.Name);       duplicatecaseIds .add(dup.IntegrationTo__c);       }     for(Case s : Trigger.new)    {         if(s.Account.Name!=null &amp;&amp; s.IntegrationTo__c!=null)         {            if(duplicatecaseIds.contains(s.Account.Name) &amp;&amp; duplicatecaseIds.contains(s.IntegrationTo__c))            {              s.addError('Record already exist with same Name');            }           }    }   }  ThAnks
I have taken three fields from case object called AccountName, IntegrationTo__c and SfType__c (checkbox).  I have created one case record with a specific combination of three fields.  For the second time I create a record with that combination, then  display error message only if SfType__c is true in first record otherwise allow  for record creation.  trigger AvoidDuplicate on Case(before insert)  {          set&lt;string&gt; newNameSet = new set&lt;string&gt;();     newNameSet = new set&lt;string&gt;();      set&lt;string&gt; newEmailSet = new set&lt;string&gt;();      set&lt;string&gt; dbNameSet = new set&lt;string&gt;();      set&lt;string&gt; dbEmailSet = new set&lt;string&gt;();      for(Case newLead : trigger.new){          newNameSet.add(newLead.Account.Name);          newEmailSet.add(newLead.IntegrationTo__c);      }      for(Case dbLead : [select id, Case.Account.Name, IntegrationTo__c from Case where IntegrationTo__c IN: newEmailSet OR Case.Account.Name IN: newNameSet]){          dbNameSet.add(dbLead.Account.Name);          dbEmailSet.add(dbLead.IntegrationTo__c);      }      for(Case newLead : trigger.new){          if(dbNameSet.contains(newLead.Account.Name) &amp;&amp; dbEmailSet.Contains(newLead.IntegrationTo__c))              newLead.addError('You are inserting Duplicate Case');      }  }   i wrote this this not checking the account field name and integration__c values only with combination of account and integration__c shows error
Why does evolution not make life longer for humans or any other species?  Wouldn't evolution favour a long life? How do I set environment variables from Java? Is there such a thing as a Ubuntu Certified Engineer? Convert XML/HTML Entities into Unicode String in Python proving $\left(1+\frac 1n\right)^{n} = 1 + \sum_{k=1}^n \{\frac 1{k!}\prod_{r=0}^{k-1}(1-\frac rn)\}$ using the binomial theorem Prove $a^\alpha b^{1-\alpha} \le \alpha a + (1 - \alpha)b, \; a,b > 0,\; 0 < \alpha < 1$ I have no idea how to do this. Any help would be appreciated. The chapter I'm on is about differentiation and the mean value theorem.  Prove $a^\alpha b^{1-\alpha} \le \alpha a + (1 - \alpha)b, \; a,b &gt; 0,\; 0 &lt; \alpha &lt; 1$ Deseasonalizing count data I used stl() in R to decompose count data into trend, seasonal &amp; irregular components. The resulting trend values are not integers anymore. I have the following questions:   Is stl() an appropriate way to deseasonalize count data? Since the resulting trend is not interger valued anymore, can I use lm() to model the trend components? How does Incense work? Error while running Quickly How would you know if your (high dimensional) data exhibits enough clustering so that results from kmeans or other clustering algorithm is actually meaningful?  For k-means algorithm in particular, how much of a reduction in within-cluster variance should there be for the actual clustering results to be meaningful (and not spurious)?  Should clustering be apparent when a dimensionally-reduced form of the data is plotted, and are the results from kmeans (or other methods) meaningless if the clustering cannot be visualized? What does eno mean in network interface name 'eno16777736' for CentOS 7 or RHEL 7? Under consistent network device naming scheme, what does 'eno' stand for in network interface name eno16777736 for CentOS 7 or RHEL 7? Does there exist a bijective $f:\mathbb{N} \to \mathbb{N}$ such that $\sum f(n)/n^2$ converges? We know that $\displaystyle\zeta(2)=\sum\limits_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}$ and it converges.        Does there exists a bijective map $f:\mathbb{N} \to \mathbb{N}$ such that the sum $$\sum\limits_{n=1}^{\infty} \frac{f(n)}{n^2}$$ converges.      If our $s=2$ was not fixed, then can we have a function such that $\displaystyle \zeta(s)=\sum\limits_{n=1}^{\infty} \frac{f(n)}{n^s}$ converges I am trying to buy a laptop, and I have seen in many place that they show GDDR3 and sometimes  DDR3. What is the difference between them?  afaik DDR3 is a type of RAM used for system memory, while GDDR3 is a type of RAM used for graphics cards. So does "G" only stand for Graphics or does it have another particular meaning? How do I force Excel (and other Microsoft Office products) to stop opening files in the same application? Whenever I "double click" on an Excel file and another Excel file is open, the newly opened file automatically opens in the same application window as the previously opened Excel file. This isn't limited to just Excel, as I've seen Word do this as well. This poses a problem when wanting to compare documents side by side.    The current solution I have for this is to actually open another Excel or Word instance, and then open the file from within that application window itself. Is there a way to force Office to open a new instance of the application when double clicking on the file icons?  I'm currently using Office 2007 and Windows XP, but I've seen this on Office 2010 and Windows Vista and 7. I'm looking for an overall solution if possible. Beamer Bibliography Icon I want to list my references in a beamer presentation using thebibliography environment, with the nice little    book icon (\beamertemplatebookbibitems) and  article icon (\beamertemplatearticlebibitems)   in front of each source.  Is there an icon for websites too? something like \beamertemplatewebsitebibitems? If not, is there a way to implement this easily ? Given the size of the Empire, it seems highly probable that names would be reused. Although I'm not aware of any in canon, there must be other Skywalkers in the galaxy, leading me to my question.  Are there other Skywalkers in the galaxy, and are they mentioned in canon? Does Luke have any third cousins twice removed (etc.)?  Bonus points if you can attest to force sensitivity among the surname. "have" vs."have got" in American and British English How to use "grep" command to find text including subdirectories I want to find all files which contain a specific string of text. The grep command works, but I don't know how to use it for every directory (I can only do it for my current directory). I tried reading man grep, but it didn't yield any help. Are there irreducible polynomials that are partially solvable by radicals? In general, polynomials of degree 5 or higher, with rational coefficients, are not solvable by radicals. There are some exceptions and trivial cases, for example $x^5-5x+12$ and $x^{100}+x^{25}+3$, respectively.  All irreducible polynomials with rational coefficients, that I am aware of, have either none or all roots that can be expressed by radicals.  Do partially-solvable irreducible polynomials exist? If they do, are there any examples known?  I mean, for example, an irreducible polynomial of $n$th degree that can be split over $Q(\sqrt{2})$ into two polynomials of 3rd and $(n-3)$th degrees, where the polynomial of $(n-3)$th is not solvable by radicals.    At  Alexander Gruber wrote:     Polynomials which are not solvable by radicals have (at least one) root that cannot be written by any combination of the operations of addition, multiplication, and the taking of nth roots.   I am not sure if he meant only reducible polynomials, and/or with non-rational coefficients, as polynomials that have "at least one" root that cannot be expressed by radicals. How do I load the contents of a text file into a javascript variable? I have a text file in the root of my web app  and I'd like to load it into a variable in javascript.. in groovy I would do this:  def fileContents = 'http://localhost/foo.txt'.toURL().text; println fileContents;   How can I get a similar result in javascript?