Dynamics CRM - Create a Plugin to add a new logical operator into the advanced find - plugins

I am trying to add a new option into the Advanced Find in Dynamics CRM 2011, yet am unable to find if there is a way to do this.
The reason is that I want to get the current user and then use one of their attributes to reduce the list of found items, for example The users list says they look after all the car sales for Texas, instead of showing all the sales in Texas for Cars and Vans I want to show just Cars. However there is someone else who wants to look at the list and see all the sales of Cars and Vans, thus I can't set the owner - if that makes sense.
So I want to be able to do is add an option into the advanced find so I can say where all the cars are in the current users list of cars they are interested in.

You can do it without creating a plugin... On the edit filter you select the object as a relational object, rather than the actual field. For example:
When you pick the field go to the "Related" section in the combo box:
Once you have done this you can chain them back to the part that you want:
Thus there is actually no need to create a plugin just as long as all relationships are created etc.

Related

Refer relevant K2 smart objects from different sources in a K2 view

I have recently started working on K2, so please take me as a starter on this one.
SmartObjects
1) I have a SharePoint Smart Object (SpSo1) which lists all vehicle details i.e. ID, make, model, specs etc.
2) And I have a SQL Server Smart Object (SqlSo1) where I am saving only the vehicle IDs against the ProcessInstance_Id.
View
The View is a Smart Object List View which is linked to SqlSo1. In the Edit Section, it has a picker control which is linked to SpSo1, and some DataLabel controls used to display selected vehicle specs. This View also contains the toolbar buttons i.e. Add, Edit, Delete Save, Refresh which execute their relevant functions using SqlSo1. The View also has a parameter called ProcessInstance_Id.
Working
When the view loads it should retrieve and load in the List Section (picker column) the list of all vehicle IDs from SqlSo1 saved against provided ProcessInstance_Id parameter. Simultaneously, against each vehicle ID loaded, it should also retrieve and load into the DataLabel columns the vehicle specifications from SpSo1 against each vehicle ID loaded.
The Edit Section in the View should allow to pick (in Picker control) and load (in DataLabel controls) vehicles using SpSo1 (which is achieved). Whereas the List Section should display data of vehicles retrieved from SqlSo1 such that Vehicle IDs retrieved from SqlSo1 and their other spec details retrieved from SpSo1 (Still to achieve and is the real question here).
Please help me in this regard. that would be so kind of you.
I have been finding difficulty resolving my issue that I raised here exactly a week ago but to the reality of this Forum I have not received even a single response from any of its gurus. and I have suffered at my work due to this.
I know I am quite new to K2 but you guys are gurus, you could have suggested at least something on my query.
Honestly, if StackOverflow is only to edit the posts and not suggest on the actual query then my suggestion to StackOverflow founders/CEOs is "SHUT IT DOWN".
Thank me.
to achieve that, you would need to add additional column to your view and to change it to List Display - where you would in turn change "Display" property of that control to show properties from SharePoint list.

CRM Dynamics trigger workflow before saving

A little background:
I have 2 entities (Product and Case). The product entity will hold all product records. A section in the Case will have the ability to choose products and auto-populate all related fields that are located in the product record for that specific product. For example, Product record has fields like hazardous, range, lot ect. The same field appear on the Case record. These fields should only be populated based on the product that was selected.
I was able to accomplish the above by creating a 1:N relationship and adding it to my Case form. I then created a workflow to populate the related fields (hazardous, range, lot ect). However, these fields only populate when the record is saved. Is there a way to make it update the fields once the product is chosen?
I want to refrain form using any type of JavaScript. If possible, I would like to strictly use workflows to accomplish this (if at all possible).
Real time information in your case can be only accomplished by using JavaScript. Maps works too but they have a special behavior.
Workflows that fire when the record is created only execute after all core operations are done (Native logic, Plug-in logic...) and you can't fire workflows if the record is not created.
So using workflows is a good idea even if you can't see the information

Global selection of Company before interacting with any other forms

I'm working on the design of a database for a client and they would like to work with one of their companies (customers) at a time throughout the entire session.
Ideally I would like to set up the forms so that they select the company to work with first and then can navigate to various other forms to manage the different aspects of that company (locations, departments, employees, etc.). There will obviously be many companies in the database, so I would need to ensure that they only see records for the selected company and adding new values ties them to the selected company.
I've been doing some searching around for how best to accomplish this but I've had no real luck.
Any guidance you can give would be awesome.
PS. I've got the structure of the database tables setup to ensure that any entity that is company-specific has a foreign key that identifies the company.
When the user enters the program, the first form they should see should be the company chooser form. Then the user can continue on to the other forms, which would all be filtered based on the user's initial selection.
You can either have the form write to a module-level variable, and all the forms would be filtered by the value of a function which would return the company ID to filter by.
It may be easier for you to simply hide the form, and filter all the successive forms by the value in the combo box of the hidden form.
You might also want to consider creating a query for each table, which contains only the filtered values per company (either with a function, or by the value of the hidden form) and basing all your forms/reports on those queries. That way you won't accidentally forget to include the filter in a form/report.

Filemaker GetSummary from related table

I'm been using FM for the first time and have a need to use Get Summary on a financial information table. This generates various summaries of different income by customer, year and type. The layout generated from this table is good. The use of Get Summary allows me to do math with the various results, whereas sub summary totals by income type (as far as I know) cannot be added and divided by each other.
The problem I'm facing is that I wish now to create a layout based on customers and include some of the Get Summary detail from the financial table. Because my new layout is based on customers, I understand I cannot use Get Summary from financial as either a related field or in a portal.
The end game is simply to scroll through customer records, one after the other, and have key financial information show on their 'home' screen if you will, for years and type.
Any help gratefully appreciated. Thanks
I understand I cannot use Get Summary from financial as either a
related field or in a portal.
No, that's not quite correct. The GetSummary() function returns the sub-summary value by breakfield - if records are sorted by breakfield. Thus if the portal (or the underlying relationship) sorts the related records by type, you will see sub-summary values in the portal. However, you won't be able to see only sub-summary values, since a portal has no sub-summary parts.
There are other ways to show summarized related data. If you don't have (and don't expect to have) a large amount of records, considering filtering a (one-row) portal to show only a specific type of related records, then place the summary field inside it. Of course, this assumes the types are known in advance and unchanging.

Connecting nodes to multiple dates

I have company website, with many offices around the world (around 50 offices).
The company want to create a gift giveaway with the employees in a specific company each specific day.
For example:
Office 1: will do the giveaway the days: 1/1/2010, 7/1/2010, 15/1/2010, etc...
Office 2: the days: 2/1/2010, 9/1/2010, 19/1/2010, etc...
Office 3: ....
Office 50: ...
(the days are setup manually to specific offices, no need of an algorithm here)
I have a node per Office, it's a CCK content type with details of each office (location, phone, email, etc), now I need to assign those days to the offices.
But my problem here is that I don't need to create events (or at least node events) because I don't need to store any data in the event. Just need to say: Office 1? Yes, days 1/1/2010, 7/1/2010, etc...
Nothing else, just to know the dates.
And, if possible, make them available to display in the calendar module.
What is your suggestion?
Withs CCK and date module you can create date fields, but if you have many fields you want to add, this might not be the best solution.
You have two general ways of solving this issue. Either you need store each date. This could be done with date field, not sure if it can handle multiple values, node reference or similar. This is inefective it some ways, but will make it easy to generate calendar view.
You could also write a string with as the date info and let php convert it to dates. This route will make it easier to create and store the data, but will make it a lot harder to get things integrated with calendar.
The fatest / easiest solution would probably be node reference with a date module, combined with a script to create all the nodes need. Instead of making them inside Drupal.
You could also create a custom module that stores this info for you. It would be a more longterm solution and require more work to integrate it with views and date/calendar modules.
There are many ways to go about this, but it really depends on your need, skill and time
Why not use a plain old CCK text field with a good clear description of what it's for and how to format it with something in the help section to back it up?
Use a text area (multiple rows) and apply the default input format that converts lines line breaks. I like to use the mark down filter too.
You could also use multiple single line fields in place of a text area...
This assumes your users are smart enough to enter the correct info of course but that's what the help and description are for. If your users can't be trusted to enter the content in correctly then yes, go for something that forces them to do so.
Ok I've found the solution myself and I want to share it with you:
Created three content types:
Office: with data of the office
Days: with a node per day (365 * year)
and Giveaway: with two node-reference fields, one for Office and another for Day.
(Days must be populated manually using a script that fills the upcoming 2 years or so).
So I can fill only Giveaway content type, and that's enough.
And then only the views are remaining.