CRM 2011 Filtering view on related record type - dynamics-crm-2011

I want to create a new view for the activities entity. My aim was to show only the activities that were related to a record of a certain type eg account. But when i was creating it i saw that aside from saying if it contains data or not, and for specific records, there isnt an option for entity type.
I can understand why this isnt an option in the list, as its not really something people would need to do, but is this possible at all?
Thanks

Create an Advanced Find and specify the following criteria:
Look for: Activities
Related > Regarding (Account)
This will get you all activities which are related to an account.

Related

Kentico - WHERE condition for custom Page Types page

I have a custom page type for employees, and one of the fields is Location. I want to show/filter only employees in "San Jose" or "San Francisco" and used this WHERE condition below but it didn't work. Apparently, I missed something very basic. Could you help?
Location LIKE '%San%';
I did another test, where instead of page type, I used custom table with the exact field names and was able to filter using the same statement. On a related note, I'm new to Kentico and exploring which is more suitable for creating/maintaining a list of about 100 employees - Page Types or Custom Tables - with the ability to filter by department, location etc. Appreciated your input here as well. Best!
If you're adding the WHERE condition into a standard Kentico repeater or other data source, the syntax looks right except you do not need the semicolon ";".
You'll also want to double check the field name, and if you are limiting your query to certain columns (as is best practice especially for larger data sets) and be sure the field you are filtering on is being selected.
Regarding the management of your employee list, either method you've described will work. In that scenario it typically depends on who will be editing the content, and how frequently. It is more editor-friendly, in my opinion, to add those documents into the content tree. This also gives you quicker control over the order, and keeps it similar to how other content on the site is maintained. I also like to set up folders or other parent page types as categories if needed, so the documents can be dragged and dropped between them and it sets up a visual taxonomy that isn't possible if it's all stored in a table. Storing items in the tree also allows for workflow and versioning, as well as more granular control over permissions/access, if this is important to you.
It's awesome that you are thinking about how to best store your data in advance. There many factors to consider such as overall number of records, number of columns, the fact whether you need to use workflow, versioning, preview etc..
The best source of information regarding this would be this article which summarizes all options you have and gives clear explanations of which to use in which scenario.
And to your original question - What components are you using to display the data? Is the repeater? If so, can you make sure to set the Page types property to match the page type you are displaying? If the page types is not configured, Kentico will not load any custom fields because it doesn't know from which table it should load the data from.
Additionally make sure to either include the "Location" field in the Columns property or leave the columns blank (not recommended because then Kentico loads all columns which is like 200. when you count all from CMS_Document, CMS_Tree etc..)
Below is the framework that I use to debug whenever I wish to add a repeater and is facing some problem.
First get all the columns instead of accessing limited columns. Fetching all columns will make sure that I don't have any problem retrieving data.
If I am missing any particular column information name, then I would double check the column name.
I verify this by firing up SQL server management studio and access data from page type table or custom table.
If access to SQL server is not available(generally in Azure hosted solutions with restrictive access to DB), I would enable SQL debug from the settings and see what query repeater is generating to see if it is correct.

How can i provide role based security to notes in MS CRM 2011

I am working on Notes in MS CRM 2011.
I have many roles over many entities.
I want role based security to notes for any entity records.
let me explain what i want:
Suppose i have an entity namely E1.
Role R1 and R2 has read and write access to E1.
But i want that user having role R2 can only upload and view notes for any record of entity E1.
Hope now my requirement is clear to all of you.
Please suggest me how can i achieve it using MS CRM 2011.
I can think of two ways to do this.
You can create a plugin on create/update of the annotation(note) and check if the note is related to entity E1 and check the roles of the user making the change and see if they only have the R2 role. If that is the case you can throw an InvalidPluginExecutionException with a message like 'You do not have permissions to edit/create these records'.
You can try using role based forms or JS to hide the notes area for R1 users.
You probably want to use a combination of #1 & #2. The users can still access the notes via advanced find and thus will be able to edit those notes. The plugin will prevent that fringe case as well.
*Edit
There are a couple more things that you might be able to deal with the advanced find records. You can remove the annotation entity from advanced find via the unsupported method described here.
Otherwise there is one more thing you can do if you want to prevent those results showing up at all, and you want to stay supported. You can write a plugin on Post-RetrieveMultiple of the annotation entity to strip out the results directly from the return result. There are a couple downsides to this though.
You are executing your plug-in every time the retrieve multiple is called on the entity. So this code will need to be as efficient as possible since that delay will be noticeable by the end user whenever they retrieve these records.
Things like advanced find will display odd results. For example if your paging is set to 50 records and you strip out 10, they will only see 40 records on their page and the total record count will include the records you are stripping out.
Through roles i don't know a way to do that, because you configure the access to notes generic, so applies to all entities. You have to access with Javascript navigating in DOM. Check a example:
document.getElementById("notescontrol").contentWindow.document.getElementById("NotesTable")
You can check this with the help of a develeper tool in your browser.

Add a field to a query where the data comes from a subform

I need to filter a a table with parameters that are calculated on a non related table, but to do this in Access web I need to add the [Project_Id] to the task list.
To clarify further, the user answers some questions regarding the details of a project, which in turn will calculate in the background a group of parameters that are needed to sort a task list.
The problem is the task list is generic and not related to a project so before I can use the project related filter parameters I need to assign a project id to the task list or there is no relationship and no way of knowing what project parameters to use.
I tried to do this with a query but being a Web database I am unable to select the data from the form control.
Hopefully someone can help me find a solution, because I have exhausted Google and my own knowledge on the subject. One last thing I am unable to use code thanks to security issues.
In case anyone is interested I found away to assign the project id to the task list using data macros.
The data macro is assigned to a table that is related to the project and when updated edits the tasks list to add the current project id for each record in the table.
I still have some issues to work around, but in general it does what I need.

How to add value to a field from another lookup field?

I have a custom entity Partnership in which I have one lookup field contacts.
now I want to add the name field value of the partnership from contact fullname in time of creation of Partnership.
is it possible with the help of pre-existing configuration settings,(without plugin or web resource)
Thanks.
Without using a plug-in or web resource you have a couple options.
1- You can configure the mappings between the 2 entities by going to the Entity (contact) -> Relationship -> Mappings -> and add a new mapping there. For this to work though, you will need to create the child record from the subgrid of the contact, and if the contact changes it won't update the values. So it may or may not be an ideal solution for you.
2- You can create a workflow rule that runs on create and/or update of the Partnership record that pulls the value from the parent contact onto the partnership record. The downside of this is that workflows are async so you won't see the update for a few seconds and refresh the Partner record.
Hope this helps.
If you want to be able to click the "New Partnership" button in the CRM ribbon, then select a contact, and have the name of the contact, be used to populate another field on the form, you will have to use JavaScript. There is no configurable way of doing it.
If you'd like the value to be populated before it is saved in the CRM database, you could use JavaScript, or a custom Plugin. If you'd like the value to be updated after the record is created, you could use a workflow.
You'll have to use one of those three methods to populate the field. The real question I have though, is why are you bothering to populate the field in the first place? You can add the full Contact name to any view, so I don't see a real big reason to include it.

SharePoint: How to filter documents in a document library

I'd like to "hide" certain documents from certain users in all places where lists are displayed. That is, the list of documents will be different for different users. For example, for user1 I want to hide documents containing "abc" and for user2 I want to hide documents containing "def".
Is there a SharePoint web part (or something) that I can deploy which will execute some code that can filter the list for all of the sites? Ideally, this "solution" would take as input a list and a username, and would return a subset of the list. And SharePoint would only display the filtered list. Also, for performance reasons, the input should not be the entire set of documents in the list, but rather just those that are displayed.
Also, I understand that one possible way to accomplish this is via permissions on the documents. Unfortunately, permissions is not something I can take advantage of as the documents have to be, in essence, public.
Also, to be clear, I am not asking about what the code should like like that does the filtering (although examples might be helpful), but rather if there exists a mechanism to accomplish the type of filtering I need.
Thanks for your help,
Eric
the best solution is absolutely permissions but if you cant use it, you can use audience targeting. go to your document library settings and enable audience targeting. after enabling, you will have audience target field in your documents.
you can have more info about audience targetting here http://technet.microsoft.com/en-us/library/cc261958.aspx
if this is not what you are looking for, you can create custom views on your library and create filters by using [Me] parameter for current user. e.g. you can create a multiple user field and write the names of people you dont want to see that document. after that you can create a view with a filter [Me] is not on that field. But you can not deny users access to document if he has permission on the document and knows the url of document.

Resources