Hello,
can anybody say me which tables should I use, when I want select contacts owned by CRMuser which are not in any marketing list?
I can write SQL query, but I do not know CRM DB structure.
*This post is locked for comments

Hello,
can anybody say me which tables should I use, when I want select contacts owned by CRMuser which are not in any marketing list?
I can write SQL query, but I do not know CRM DB structure.
*This post is locked for comments
why are you using SQL queries , instead you can try advanced find frm contacts
there you can select Contacts Owner by staff member or members then related entity list you can see Marketing List then Marketing list type contact
It can not be find with advanced search. If you set related entity marketing list, then it supposed at least one marketing list is associated to the contact.
Can be searched contacnts owned by user which are in (anyone) marketing list but can not search contacts which are not in any list.
Marketing List records table is call 'List'
and Marketing List Members in table "ListMember'
this is not Guarantee but you can try
select contactId from contact where statecode=0
except
select EntityId from ListMember where entitytype=2 -- 2 indicate contact
this will give you all live contacts Ids except the once in List members
so to get fields you need
you can try select emailaddress, fullname .......<fieldnames> from contacts where contactId in (<above sql>)
try this as these are select sqls no harm to your crm database.
This is pretty rudimentary, but should expose what you're looking for....
SELECT * FROM Contact WHERE ContactId IN (SELECT EntityId FROM ListMember)
Hi,
Just to add always use Filtered Views (auto created for each entity) instead of querying tables directly, as it will bypass the Security Role of the user. Use FilteredContact, FilteredList & FilteredListMember views.
Thanks,
Gopal Kanojiya