How to add columns to ListMember table in Microsoft CRM? - dynamics-crm-2011

For the n:m list membership, Microsoft CRM uses an intersect table called ListMember. With a solution/plugin I need to attach new columns to this table. I know that I could create a new entity with this and keep it in sync with ListMember, i.e. creating one whenever a member is added to a list and modifying it when a member is moved to a different list, etc. But that's quite a lot of overhead I think.
Is there a way to attach new fields to to the ListMember entity in CRM 2011?
Source: How to integrate with Dynamics CRM Marketing Lists with a plug-in

If you need to have additional fields for a many-to-many relationship you must create a manual relationship (by creating an intermediate entity.) This is not an oversight, it is in the Dynamics CRM training material.
As for Marketing Lists, you shouldn't be trying to add more information to this relationship - it is a flaw in the solution design/architecture.
You wouldn't need to keep anything in sync. Use Dynamic Marketing Lists and they will be kept in sync. The only purpose of a Marketing List is to create the activities for a Campaign/Quick Campaign. If Marketing List membership is being used for another purpose that is a solution design issue that needs to be resolved.

Related

Class diagram for a mini JEE project

I want to start a project in JEE and I need to confirm about my class diagram. I need to know if the methods used are correct and if the composition I used is correct or not.
This is my class diagram:
The project is about an online sales store, that wants to set up a management tool to sell products, and to manage its products. This tool must include the following features:
Identification module: identification of clients, managers, supervisors
Sales module: make purchases for users
Product Management Module: Adding / Deleting Products
Statistical module: visualization of sales statistics
Functional Specifications
It is necessary to act on the application, to connect to the application with a user ID and password. To facilitate its use and in order to avoid any mishandling thereafter, here is the solution:
User Profile:
The user will be able to visualize the products sold by My Online Races. The user can place an order, provided that he has registered with the site My Online Races.
Manager profile:
The manager will be able to manage the products:
Add / Edit / Delete Products
Add / Edit / Delete category
These data insertions can be made using CSV or XML files, but also through various forms on the website.
The manager will be able to view the sales statistics.
Supervisor Profile:
The supervisor can add managers whose roles are specified above.
The supervisor will be able to view the sales statistics.
The supervisor will be able to view all the actions performed by the managers, a sort of audit trail.
Well I wish to know already if you have remarks about my design. As well as I have a confusion for several methods, for example adding, modifying and deleting a product. Should I put them in the manager or product class? Is the composition I put correct or should I remove it?
Quick review of the diagram and advices
First some minor remarks about class naming: Ordered should be called Order.
The composition between Article and Order is just wrong (not from a formal view, but from the meaning it conveys). Use a normal one-to-many association: it would reflect much better the real nature of the relation between the two classes. Please take into account that a new article may exist without having been ordered, so it shoud be 0..* instead of 1..*
+belongs and +do in the middle of an association are syntactically incorect. You should use a plain triangle instead (or nothing at all). The triangle should be oriented in the reading direction Person do |> Order and Article belongs to |> Category
The methods seem ok. You do not need to add a suffix.
How shall objects be managed (created/updated/deleted) ?
A more advanced concern is not about the diagram but about how you want to organise persistence (i.e. database storage):
do you really want the object to be an active record, that is an object that adds, updates and deletes itself (to the database) ? It's simple to set up, works well, but makes the class dependent on the underlying database implementation and thus makes maintenance more difficult;
or wouldn't it be better to use a repository for each object ? In this case the repository acts as a collection that manages all the database operations. The domain object (Article, order, User, ...) then have nothing to know about the database, wich leads to more maintainable code.
But this is a broader architectural question. If it's just for a first experimental project with JEE, you can very well use the active records. It's simpler to set up. Be sure however in this case to disambiguate the Add/Update/Delete on Person, since it currently may give the impression that any person can add anyone.
Improvement of the model
A final remark, again not about the diagram itself, is about the domain. Your model considers that an Order is about a single Article.
In reality however, orders are in general about one or several articles: if this would also be the case here, your Order would become an OrderItem and the real Order would be inserted between Person and OrderItem. You could then make the relation between Order and OrderItem a composition (i.e: OrderItem is owned by Order, which has responsibility for creating its items, and the items have no sense without the related order).

How can I remove an Implicit Share in CRM 2011?

Was wondering if anyone could offer some insight to how I would remove an Implicit Share in CRM 2011... The situation goes like this: I have a custom entity that can get nested under other entities of the same type. The parent entity is owned by Team A. The child is owned by Team B. Users who are members of Team A can see the entity owned by Team B because of the Relationship Behaviors (parental) that were set up...
This behavior was giving us a big headache because we were trying to control visibility of that record by team ownership. We finally pinned it to the Relationship Behaviors setting. We set that for Referential, and the problem has gone away for any new child entities we create, but not for the ones that are already there. I'm looking to remove this implicit share without having to remove/recreate the affected entities as that would take some time due to the number of them there.
Just looking for a different angle on this, or some ideas/direction on how to easily remove these relationships.
Thanks for any help! :)
So, here's what I found... We can either zero out the relationship in the POA, or we can recreate the records... We tried reimporting the records from a development org we have, but the problem persisted since we are using clones (same guids)... We have to reimport to the dev org with new guids, and then can promote to test org using clones at that point...

CRM 2011: How to call Workflow activity on relationship entity

I have a relationship entity Fixture_In_Series which holds a relationship between FIXTURE and SERIES entity. Whenever any new fixture is associated/linked to a series a new record is generated in fixture_in_series.
I want my custom built Workflow Activity to fire whenever a new Fixture is associated to a Series and then it will do a job.
I can see Fixture and Series entity in the list when creating a new process but obviously Fixture_In_Series is not there as it is a relationship only.
Thanks for any suggestions.
I believe associate event is not possible to attach.
So i suggest you to use the OnUpdate\OnCreate Entity event and check if the lookup field Fixture has been filled.
From what you are saying it sounds like you are using a native many to many relationship between Fixture and Series. These entities cannot trigger workflows.
Two options that I see. Change your workflow to a plug-in and trigger it on the associate event.
Or, re-create your relationship as a custom many to many relationship. This involves you creating the intersection entity yourself, then you can trigger workflows on the update/create of the records in the intersection entity.

MSCRM 2011 - making relationships between many entities

I want to create a custom entity linked to the contact entity.
The purpose of this new entity is to store competitors of a contact (it is not like the default MCRM competitor entity that as for purpose to store your own competitors).
I tried many ways to do that by creating an entity with single names of competitors & an entity linked to contacts to store competitors names but after, you get the "add a new competitor" & "add an existing competitor" that are refering to the second entity I created: you see the whole list of competitors including duplicates (if many contacts have the same competitor, you see many times the same competitor name).
Is it a relationship problem, or should I use an other way?
Thanks
Did you create a 1 -> Many relationship? E.g. When two contacts share the same competitor you create 2 competitor records.
Try using a Many -> Many relationship, that way two contacts can share the competitor record, e.g. you have 1 competitor record for 2 contact records.
This should reduce duplication.

Get the related entity crm

I have two entities on the CRM Organization "Template" and "Product" with a relationship 1:N. A "Template" can be related to multiple "Product", I want to get all the "Product" related to a "Template" using C#.
Ex:
Template1 is related to three Products P1,P2 and P3. I want to retrive the P1,P2 and P3 when I retrive the Template1 entity. I want the related entity.
Technically speaking, it's the other way around. It's the three instances of the entity Product, i.e. P1, P2 and P3, that are linked to your instance of entity Template, i.e. Template1.
What technique are you going to use to fetch those? In C#, I'd go with QueryExpression (but some people would prefer using fetch XML). In JavaScript, I'd make a REST call to the OrganizationData web service. From GUI, advanced search (I think, at least, since I'm not commonly working using the GUI).
In addition to Konrad's answer, you can also use LINQ to CRM. If you've used LINQ in the past, I'd recommend that since Query Expressions can be kind of verbose.

Resources