Partylist in Microsoft Dynamics Crm 4.0 - dynamics-crm

Is it possible to create an attribute of type Partylist in Microsoft Dynamics Crm 4.0?

The PartyList type is basically a system control to display a n:n relationship on emails. Right now, we are not allowed to create new attributes of type PartyList.

<attribute PhysicalName="to">
<Type>partylist</Type>
<ValidForCreateApi>1</ValidForCreateApi>
<ValidForUpdateApi>1</ValidForUpdateApi>
<ValidForReadApi>1</ValidForReadApi>
<IsLogical>1</IsLogical>
<AttributeTypeId>00000000-0000-0000-00aa-110000000039</AttributeTypeId>
<DisplayMask>ValidForForm|ValidForGrid|RequiredForForm</DisplayMask>
<Descriptions>
<Description description="Sending Mails to the specified Users." languagecode="1033" />
</Descriptions>
<ImeMode>auto</ImeMode>
<RequiredLevel>none</RequiredLevel>
<Format />
<LookupClass>SystemUsers</LookupClass>
<LookupStyle>multi</LookupStyle>
<LookupTypes>
<LookupType id="f93fb506-2341-db11-898a-0007e9e17ebd">8</LookupType>
</LookupTypes>
<displaynames>
<displayname description="Users" languagecode="1033" />
</displaynames>
</attribute>
Just add code to any entity where you want Party list attribute.
Tested working Fine.

Related

When i add the "ItemSend" Event handler in my add-ins manifest.xml thrown error while installing the add-ins

In outlook add-ins try to add the ItemSend Event handling trigger in the manifest file ,but when i try to install manifest.xml not installing some error thrown
How to add the item send Event handler on my outlook add-ins
How to trigger this when click the save button , how to trigger the event on my commands.js file
Note : my add-ins developed by using javascript
Any thought about that please share me
Thanks in advance
First of all, make sure the right requirement set is specified in the manifest file. You must specify at least the 1.8 set for the ItemSend event because the on-send feature was officially released in requirement set 1.8. Read more about requirement sets in the Requirements for running Office Add-ins article.
In the manifest file, you typically need to include the function file and function name that should be called on the ItemSend event. The operation runs synchronously.
<Hosts>
<Host xsi:type="MailHost">
<DesktopFormFactor>
<!-- The functionfile and function name to call on message send. -->
<!-- In this case, the function validateBody will be called within the JavaScript code referenced in residUILessFunctionFileUrl. -->
<FunctionFile resid="residUILessFunctionFileUrl" />
<ExtensionPoint xsi:type="Events">
<Event Type="ItemSend" FunctionExecution="synchronous" FunctionName="validateBody" />
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
The on-send API requires VersionOverrides v1_1. The following XML markup shows you how to add the VersionOverrides node in your manifest.
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
<!-- On-send requires VersionOverridesV1_1 -->
<VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
...
</VersionOverrides>
</VersionOverrides>
Read more about that in the On-send feature for Outlook add-ins article.
You may also find the Outlook-Add-in-On-Send sample add-in on GitHub.

Is there any UI in Windows 10 to change the current MAPI provider?

I want to write a custom send mail handler for Windows, including a Simple MAPI provider.
On Windows, the current MAPI provider is stored in
HKCU/SOFTWARE/Clients/Mail
and
HKLM/SOFTWARE/Clients/Mail
(the former overriding the latter). But I found no Windows 10 UI to change this registry setting. In particular, when the user changes Settings -> Default apps -> Email, Windows changes the mailto association which is a separate setting, but the MAPI registry keys stay unchanged. Is there any way to change the MAPI provider or execute custom code when the user chooses a different default email app?
These are the registry keys I install to make my MAPI provider known to Windows:
HKLM\SOFTWARE\Classes\CustomMapi.Mailto Type="string" Value="URL:MailTo Protocol"/>
HKLM\SOFTWARE\Classes\CustomMapi.Mailto Name="URL Protocol" Type="string" Value=""/>
HKLM\SOFTWARE\Classes\CustomMapi.Mailto\DefaultIcon Type="string" Value="[TARGETDIR]mailtohandler.exe,-1"/>
HKLM\SOFTWARE\Classes\CustomMapi.Mailto\shell\open\command Type="string" Value='"[TARGETDIR]mailtohandler.exe" "%1"'/>
HKLM\SOFTWARE\RegisteredApplications Name="CustomMapi" Type="string" Value="SOFTWARE\Clients\Mail\CustomMapi\Capabilities"/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi Type="string" Value="CustomMapi"/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi Name="DllPath" Type="string" Value="[TARGETDIR]custommapi.dll"/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi\Capabilities Name="ApplicationName" Type="string" Value="CustomMapi"/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi\Capabilities Name="ApplicationDescription" Type="string" Value="A custom MAPI provider."/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi\Capabilities\StartMenu Name="Mail" Type="string" Value="CustomMapi"/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi\Capabilities\URLAssociations Name="mailto" Type="string" Value="CustomMapi.Mailto"/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi\DefaultIcon Type="string" Value="[TARGETDIR]mailtohandler.exe,-1"/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi\Protocols\mailto Type="string" Value="URL:MailTo Protocol"/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi\Protocols\mailto Name="EditFlags" Type="integer" Value="2"/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi\Protocols\mailto Name="URL Protocol" Type="string" Value=""/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi\Protocols\mailto\DefaultIcon Type="string" Value="[TARGETDIR]mailtohandler.exe,-1"/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi\Protocols\mailto\shell\open\command Type="string" Value='"[TARGETDIR]mailtohandler.exe" "%1"'/>
HKLM\SOFTWARE\Clients\Mail\CustomMapi\shell\open\command Type="string" Value='"[TARGETDIR]mailtohandler.exe"'/>
Since I didn't find the GUI myself I did put some simple powershell one together. You can check it here https://github.com/schtritoff/SetDefaultMAPIClient
Also, if you want to use MAPI from your WinForms app to precreate email in default MAPI email client you can use this library https://github.com/PandaWood/Simple-MAPI.NET#should-i-use

How to implement custom FetchXML with aggregate as a System View in Dynamics365

I have a custom entity called course enrolment which has a lookup to the contact entity.
I want to a view of contacts that have an active course enrolment.
I don't believe that this can be done from the contact entity, so I have to create a view of active course enrolments which only displays the contact fields.
Doing this will give me duplicate contacts if they have more than one course enrolment which I do not want.
To avoid this, I tried creating an aggregate query in FetchXML:
<fetch version="1.0" aggregate="true" >
<entity name="flr_courseenrolment" >
<link-entity name="contact" from="contactid" to="flr_contact" alias="a_69c0f6b80d94e711812ae0071b66a541" >
<attribute name="emailaddress1" alias="contactemailaddress1" groupby="true" />
<attribute name="fullname" alias="contactfullname" groupby="true" />
<filter type="and" >
<condition attribute="statecode" operator="eq" value="0" />
<condition attribute="flr_islearner" operator="eq" value="1" />
<condition attribute="flr_advisor" operator="eq" uiname="Test User" uitype="systemuser" value="{28C0D53B-5E19-E611-8106-C5346CC262D1}" />
</filter>
</link-entity>
<attribute name="flr_courseenrolmentid" alias="aggregateflr_enrolmentid" groupby="true" />
</entity>
</fetch>
This query works in the XRM Toolbox FetchXML Tester. But will not work when I import it into CRM.
I am importing it into CRM by exporting a solution containing a view that contains the same fields; and replacing the FetchXML that was generated by the system by the FetchXML that I created, and re-importing it.
I receive a generic CRM Error when trying to view this view after importing it again which says that "Columns should always be specified on Retrieve Multiple."
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ActivityId>b3b1d783-a8be-4454-9ed5-b71c42053299</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>System.Xml.XmlException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #2955ADDE</Message>
<Timestamp>2017-09-11T03:22:55.50674Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>b3b1d783-a8be-4454-9ed5-b71c42053299</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Columns should always be specified on RetrieveMultiple.</Message>
<Timestamp>2017-09-11T03:22:55.50674Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>b3b1d783-a8be-4454-9ed5-b71c42053299</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d4p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>System.InvalidOperationException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #F043AB2E</Message>
<Timestamp>2017-09-11T03:22:55.50674Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>
I have a feeling that either:
The alias on the flr_courseenrolmentid is causing the view to break
Aggregate/groupby is not supported at all in CRM views
I need to customise the LayoutXML in some way as well as the FetchXML
Is what I want to achieve possible? Is there a way to display this FetchXML in a view in CRM, or is there another way to achieve the view I need?
Create the view under Contact.
as conditions, Pick the related entity "Course Enrollment (Contact)" (i'm assuming the name here) and as conditions put "Contact contains data" and "Status equals active".
This is the same as fetching all accounts with active contacts.
You cannot use aggregate queries in views, unfortunately.
It would probably help by adding distinct="true" to the fetch element, and not using aggregate.
Easiest way to test your different options is to use the FetchXML Builder plugin in XrmToolBox, from this you can open the view you would like to alter, change the query, and then save it back to CRM. No solution imports or manual customizations.xml editing necessary.

CRM 2013 : Closed activities navigation missing for system entities

I have a problem with my CRM 2013.
In custom activities, when I open the navigation, I can see both "activities" and "Closed Activities". But if I look in Contact, Account or Lead, I only have "Activities" and the "Closed Activities" is missing.
I think this is not related to my organization since I checked with others and it's the same.
I tried to export the contact entity with one custom entity and I opened customization.xml : The NavBarByRelationshipItem is present in contact (but not in the custom entity where it works...weird...) and it looks totally valid:
<NavBarByRelationshipItem RelationshipName="Contact_ActivityPointers" Id="navActivityHistory" TitleResourceId="Tab_Label_History" Icon="/_imgs/ico_18_history.gif" ViewId="21E2B905-6FDB-470d-8517-AD69B4C01268" Sequence="21" Area="Info">
<Privileges>
<Privilege Entity="" Privilege="ReadActivity" />
</Privileges>
<Titles>
<Title LCID="1033" Text="Closed Activities" />
</Titles>
</NavBarByRelationshipItem>
Users really want this and I really don't understand why I can't find any info on this problem.
Thanks a lot!
Create a new Form for the entity (i.e. Contact) and publish it. Open a new Contact record using the new Form. If you see that the new Form shows the Closed Activities navigation menu, then download the customization of Contact and compare the FormXml of the original Form and the new Form.

BIDS and FetchXML not returning expected results

I have recently started working with Microsoft CRM 2011 and downloaded the CRM 2011 Developer Kit to get myself up to speed on the various aspects of CRM but I have run into a slight problem: one of the exercises has you generate a report in CRM and then download the FetchXML which is then loaded into a report within BIDS. In CRM the query returns what I would expect (all of the contact records) but when I run the same query from within BIDS it only returns the Contact records that are loaded as sample data and not the additional contact records that I have loaded as part of the exercise.
The relevant FetchXML is:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="contact">
<attribute name="fullname" />
<attribute name="contoso_type" />
<attribute name="parentcustomerid" />
<attribute name="contactid" />
<attribute name="contoso_lastworkoutdate" />
<order attribute="fullname" descending="false" />
<filter type="and">
<filter type="or">
<condition attribute="lastusedincampaign" operator="olderthan-x-months" value="3" />
<condition attribute="lastusedincampaign" operator="null" />
</filter>
</filter>
</entity>
</fetch>
Is there some setting that the exercise documentation overlooked that needs to be set to download the additional contacts or am I missing something else entirely?
--- Edit ---
It is worth noting that when the RDL is uploaded back to CRM all of the data that I would expect to be in the report is there but when it is local it just contains the sample data.
It's a security issue on the server locally.
Because you are using FilteredViews (I hope & presume). These are views that filter out records you don't have access to. You don't have access to those specific records locally, but on the CRM you do.

Resources