BIDS and FetchXML not returning expected results - dynamics-crm

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.

Related

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.

Jquery ajax doesn't work on phonegap app

I have been working on a phonegap app and it was working perfectly fine until today when the Ajax post request would get stuck loading and the success or failure callbacks are not being called but when I try it on the browser it works perfectly fine.
Has anyone came across this problem and if so how did you manage to fix it?
Thank you in advance
EDIT:
This is my first hybrid app and i am not using desktop app. for now I am only targeting iOS and the target version is 3 and I am using build
The newer version of the phonegap automatically blocks all the requests made to any server. You need to follow the instructions to make it work.
Add the "Cordova Whitelist Plugin" in your config.xml
<gap:plugin name="cordova-plugin-whitelist" spec="1.1.0" />
Or simply
<plugin name="cordova-plugin-whitelist" spec="1.1.0" />
After that try putting the following in your config.xml
<content src="index.html" />
above mentioned is the path to your HTML file inside the source directory.
<access origin="*" />
will allow you to make request to any of the server using ajax. If you want to restrict your app to just a single domain then use something like this.
<access origin="http://yourdomain.com" />
At the end, put the following intents
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
For Android users who have this (I know that's not the original question):
I had the same problem, and spent a lot of time flailing unsuccessfully with the various whitelist directives as described above. Actually, my problem was different: my .apk file had not been correctly signed. Bizarrely, my Android phone did not kick it out at the point of trying to install the .apk: it simply failed as soon as I attempted to make an ajax call. I found the problem because Google Play refused to accept the upload.
I'm using Adobe PhoneGap Build to create the .apk: the problem was fixed when I added my Android keystore to the build (and disabled debug, which I don't think was relevant, but I'm not sure).
its work for me :
in path platforms/android update file AndroidManifest.xml :
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

Parse - Installation table not setting deviceToken nor pushType

I had an app working on Parse, with the notifications working fine. I changed app packaging and I create a new app on Parse.
With the new app, deviceToken and pushType columns remain always empty on table _Installation, so pushes doesn't work even if sent from Parse web page, and a new entry is generated as application is launched.
I've updated parse keys on my java code and on my cloud code.
Someone has some idea what I may have missed or what may happen so the same code has different behaviour in different apps with equivalent configurations?
If I update one of the installation with pushType="gcm" and "deviceToken" the one I had in the other app, this device receives notifications.
Thank you
okay, I had a similar issue. both those columns were empty.
this is mainly due to the manifest issue.
your permissions seem okay because you are getting the notification and also able to reg in the parse data base.
so the problem should be in the <receiver> tags there should only be 2 of them like mine.
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<!--
IMPORTANT: If you change the package name of this sample app,
change "com.parse.tutorials.pushnotifications" in the lines
below to match the new package name.
-->
<category android:name="com.example.ifis" />
</intent-filter>
</receiver>
if you have any receiver like "com.google.android.gcm.GCMBroadcastReceiver" pls remove and also one <service android:name="com.parse.PushService" />
Enable parse logging:
Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);
In my case I was missing GCM permissions
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="my.package.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="my.package.permission.C2D_MESSAGE" />

Parse.com how to enable client pushes

I'm targeting specific users when sending Parse notifications, using their email address. The send seems to work okay, but no message is received. What do I need to change to receive the message?
In my Parse control panel it shows the attempted pushes but with the error message that "client-initiated pushes are not enabled". I really prefer initiating the pushes from the client. How do I enable that? I keep finding documentation that says to enable client pushes but I can't find how to do it.
Here is my setup:
Parse.initialize(this, "...xxxAPP_ID", "...xxxCLIENT_KEY");
PushService.setDefaultPushCallback(this, MainActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
ParseObject parseObject = new ParseObject("defaultObject");
parseObject.put("email", sEmail)
parseObject.saveInBackground();
The actually sending is done here:
ParseQuery pQuery = ParseInstallation.getQuery();
pQuery.whereEqualTo("email", ToUser);
ParsePush parsePush = new ParsePush();
parsePush.setQuery(pQuery);
parsePush.sendMessageInBackground("You have pictures waiting from " + sEmail, pQuery);
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:protectionLevel="signature"
android:name="com.pictureplay.permission.C2D_MESSAGE" />
<uses-permission android:name="com.pictureplay.permission.C2D_MESSAGE" />
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.pictureplay" />
</intent-filter>
</receiver>
Update: I have narrowed the problem down to push notifications being received unless the service is not running. I thought the Parse service was supposed to load when the phone restarts, but this is not the case here. Is there a way to get the Parse service for my app to load when the phone reboots?
Update2:
The solution was to create a separate class (called "App" in my case) which initializes Parse. If the Parse service gets shut down when the app closes, the service restarts itself within minutes (automatically, I did no special setup for this) to be able to receive incoming push messages. These are the lines of code used in "App" onCreate:
Parse.enableLocalDatastore(this);
Parse.initialize(this, "data1", "data2"); //supply your own
PushService.setDefaultPushCallback(this, MainActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
Have you enable Sending notifications from Client. Its a setting in Parse.com.
Go to settings ->App Permissions ->Allow client class creation. Set it to ON>
In your parse application Go to settings > Push > Client Push Enabled > set to Yes
The question Is there a way to get the Parse service for my app to load when the phone reboots? : Yes you can receive the BOOT_COMPLETE event if you have added the following permission on your manifest.
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"></uses-permission>
In the new Parse DashBoard: go to settings---> push ---> push notification settings---> client enabled push --- >set to "yes"

Partylist in Microsoft Dynamics Crm 4.0

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.

Resources