I'm trying to get a list of contacts who are linked to one record in a Custom Record Type but NOT linked to another record in the same CRT. For example:
Let's say I have the following Custom Record Type:
<em><span style="color:'"DimGray"'">Name:</span></em> ContactHasThings <em><span style="color:'"DimGray"'">Fields:</span></em> Contact (List/Record : Record = Contact ThingName (List/Record: List = Things) ThingDate (Date) <em><span style="color:'"DimGray"'">Parent: </span></em> Contact
with sample records of:Kevin, Blue Thing, 31-MAY-2008 Mary, Blue Thing, 31-JANUARY-2008 Fred, Red Thing, 03-FEBRUARY-2009 Joan, Green Thing, 27-OCTOBER-2008 Mary, Green Thing, 09-MAY-2008 Joan, Blue Thing, 28-FEBRUARY-2009
Now, let's say that I want a list of people who are linked to the Blue Thing, OR Red Thing but NOT the Green Thing - i.e. I want the results to show Kevin and Fred, but not show Mary or Joan.The results would give me the name of the person (Kevin or Fred) and the ThingDate (31-MAY-2008 or 03-FEBRUARY-2009 respectively), so that then I can, for example, create a new record giving Kevin and Fred the Green Thing with the same date as their Blue Thing and Red Thing respectively (i.e. everyone that has a Blue Thing or Red Thing gets a free Green thing (yay!), but ONLY if they don't already have a Green Thing), and so, because Mary and Joan already have Green Things, they shouldn't appear in the search results.How can I create this using a Saved Search?My first stumbling block is, this: assuming that I want to look at the "ThingBoughtDate" for Kevin, do I create my search choosing the "ThingTheyHave" Custom Record Type as my "Search Type"? I assume YesNext it's how do I add the criteria? Using Expressions I tried the following:ThingName is not Green Thing AND (ThingName is any of Blue Thing, Red Thing)
However, when I look at the list I see all 3 Blue Thing and Red Thing owners, regardless of whether they have a Green Thing or not.i dunno, perhaps this is too complicated for me to ask here, as I'm certainly having trouble describing it.. but here's another way of asking the question.if I were to do this via ODBC, but query would be:SELECT contact FROM ContactHasThings WHERE ThingName = "Blue Thing" AND NOT ThingName = "Green Thing"This would give me "Kevin" and "Fred" as the results, being the only contact with a Blue Thing or Red Thing but NOT a Green Thing. How can I recreate that query in a NetSuite saved search?