Dynamics CRM 2016 modify list of activities views - dynamics-crm

I am very new to MS Dynamics. I am using dynamics CRM 2016 and I need to remove, in the activities page, the views about entities that I am not using such as Campaign Response, Campaign Activity, etc.
I do not see them in the list of views of the Activity entity in my solution, so I cannot remove them from there, am I missing something? Is there a way to remove those views?

Its possible. I found the way to do it finally after just 3 days of research.
Open your CRM web in XRM Tool kit (download if not having it)
XRM toolkit access your org using url and login. Assuming you have privilege access.
Load all web resources and scroll down to find "activitypointer_ribbon_home.js"
Add below lines of code into the file,
finally Save and publish to make it available for all users. Whoa.. it works like charm !!!
hideactivitiesview() // call under onload of xrm page; comes in default script of this file
function hideactivitiesview()
{
var viewSelector = $('#crmGrid_SavedNewQuerySelector')[0];
if(viewSelector)
{
$(viewSelector).click(function(){
var _activity = $('#ViewSelector_activity')[0]; //get this id from DOM using F12
if(_activity)
$(_activity).hide();
});
}
}

Unfortunately you cannot hide/remove those.
Reason: They are not usual views, they are part of System tailored Activity entity family (Activity, Activity Pointer, Activity Party, Custom Activity types, etc).
If you see any Activity entity properties, the checkbox 'Display in Activity Menus' is checked & disabled. This settings is being used for navigation, views, filters, etc.
Even while creating custom activity, this option is enabled & if you forget to check it, that particular Custom Activity type will be hidden from everywhere wherever you are using its siblings (Email, Fax, etc)
If its unchecked, Even Associated view will not be showing this activity under it's regarding Parent record, which is failing the main reason why we are using CRM & activity relationship.
In a nutshell, this setting once enabled, cannot be undone. The activity cannot be distinguished/disabled using security role, because all are of same bucket.
Maybe you can try some unsupported customizations using DOM explorer in javascript & hide it, which I don't recommend. PowerObjects blog talk about renaming it to something to avoid users using it & other options.

Related

Getting the appid included in the Record URL(Dynamic) in a Dynamics 365 email workflow

I've been tasked with creating a workflow in Dynamics 365 which can send emails (the easy bit). However, the email has a link to the record (also easy using the Record URL(Dynamic) attribute). However, we use Apps in our Dynamics instance and the link generated by the workflow using Record URL(Dynamic) doesn't include the app id and so when users click the link they are taken to Dynamics but are now outside the app.
My question is, is there a supported way to appending the App Id to the Record URL(Dynamic) attribute?
I've already searched for answers to this and cant find any. My solution was to create an Action which takes as input the Record and app ID, appends them and outputs them as an output parameter. This works to be honest, but I'm wondering if I'm reinventing the wheel and there is an easier way to achieve this.
Thanks and hope this helps anyone else with the same issue.
We can get the Application ID from Xrm.Utility.getGlobalContext();
The application ID is one of the properties that returned
var globalContext = Xrm.Utility.getGlobalContext();
globalContext.getCurrentAppProperties().then(
function success(app) { console.log(app.appId); }, function errorCallback() { console.log("Error"); });
For more details refer to Here
While we are waiting for MS to give the OOB option to choose Model driven app Id & embed in Record url of WF, I recommend you to follow Andrew Butenko’s workaround using Ultimate Workflow Toolkit to achieve it with no code.
This is basically using UWT custom step to append App Id with Record url on the fly.

Is it possible to get data of several selected mails inside an outlook web add-in app?

inside a Outlook COM Add-in (C#) I was able to retrieve all selected mails inside Outlook like this
var selection = Globals.ThisAddIn.Application.ActiveExplorer().Selection;
List<Outlook.MailItem> outlookMailList = new List<Outlook.MailItem>();
foreach (object mail in selection)
outlookMailList.Add((Outlook.MailItem)mail);
to store the selected mails with some meta data inside a DMS.
Now I would like to do the same with the Javascript API for Office (office.js).
What is the correct entry point here? Because when I select more than one mail inside Outlook the OutlookTab-buttons inside the default ribbon get deactivated.
see also http://bettersolutions.com/javascript-api/hosts/extensionpoint.htm
For retrieving the mail information I have found
selectedMail = Office.context.mailbox.item;
How can I get now the data for all marked mails in Outlook. I expected to have something like
selectedMails = Office.context.mailbox.items;
// OR
selectedMails = Office.context.mailbox.selectedItems;
Does someone know how to retrieve the information which mails were selected to the TaskPane or maybe a CustomPane? Respectively if it is even possible?
Thanks a lot.
Unfortunately Office JS API built for handling a single item. Handling multiple items is not possible.
If this is a new feature you want to include in the future, you may submit a feedback.
https://officespdev.uservoice.com/​
Best regards

Custom Field Alert in TFS 2015

The question is the following:
I have a custom Requester field in TFS work items. It contains a valid TFS user name.
Is it possible to send an email to the person specified in this custom field, when the item changes a state?
In other words:
Requester = [Me]
Send email on State change
From the following questions :
1) “[Me]” variable for custom field alerts in TFS 2013
2) How to create custom Field with transition workflow in TFS
I figured out that custom fields (such as Requester) do not have = and <> operators. They have only Change, Change to, Change from. Thus it is not possible. (You can only observe the changes made to the custom fields)
Has anybody seen, herd or implemented a solution to this? Maybe a custom plug-in?
Thank You in advance!
You're looking at a server side event handler to achieve this.
Intercept the Work Item changed event
Check if the change was a
change in state
If it is, then email the address listed in the
Requester field.
There are couple of old projects on codeplex which should get you up and running but you'll need to update for TFS 2015 (and test with any updates you apply later)
Email alerts for TFS
TFS Work Item Watcher
There is a feature that just popped into VSTS that makes this a little slicker
Follow a Work Item
Although you would get notified on all changes rather than just state change
The feature was added in TFS "15" (not the same as TFS2015, see Brian Harry's blog post)
The feature is not enabled publicly yet, but there is a feature flag that you can turn on by changing a value in the team foundation registry to enable it - because it's not public yet you will have to contact Microsoft for instructions,
I have provided my email in the blog post
https://blogs.msdn.microsoft.com/rihamselim/2016/09/07/enabling-alerts-for-custom-fields-in-work-item-alerts/

Click-To-Call feature for Dynamics CRM (like Lync/Skype)

Advance warning: Im an absolute newbie to Dynamics CRM!
Intention
I want to have a feature like Lync/Skype integration but use my own URL. (Click on any telephone number inside CRM and call it).
For eg. assuming I have a web service which can initiate a call per URL: http://telephony.com/call?nr=012345678. Now, whenever a CRM user clicks onto a telephone number field (in forms and views) inside the CRM my web service should be called instead of Skype/Lync.
In fact I'm trying to reproduce sth. like the InGenius Connecter.
Attempts
I already tried to inject a JS web resource to a specific formular (in my case it was the default contact form) and override the Mscrm.ReadFormUtilities.openPhoneClient callback (which seems to handle the Lync/Skype integration).
function load() {
// override integrated CTC (Lync/Skype)
Mscrm.ReadFormUtilities.openPhoneClient = function (telephoneNr) {
// redirect user to my web service
window.location.replace("http://telephony.com/call?nr="+telephoneNr);
return;
}
}
Found this method at: Disable Lync completely
This does work well in forms of Dynamics 2015 (my custom link pops up instead of Skype/Lync). However, this does only work on entity forms since I can't inject web resources into an entity view.
My other ideas how to implement such a feature are:
Inject global JS resource which disables Lync/Skype and encapsulate every telephone number with link to my custom URL.
Extend/Manipulate Lync/Skype integration to use my custom URL instead of Lync/Skype.
Write plugin which encapsulate telephone numbers server side.
Question
Since I have a grasp understanding of Dynamics and no experience in plugin/resource development, I'm left a bit confused with these questions.
Is it possible to achieve any of the three ideas above ?
If not, any idea how InGenius solved this problem ?
Do you have any other idea/resources about this topic ?
Currently I found two options available to achieve a custom CTC feature. (Both has the downside of not being officialy supported by the dynamics crm.)
Global Ribbon
Pretty simple: Add a Click-To-Call button to global ribbon which is only enabled on specific grids when one row is selected.
This button refers to an JS-Action which retrieves the telephone number via ODATA and then launches the dial process.
Global Ribbon CustomRule injection
Add a global button to ribbon which refers to a JS resource per <CustomRule>. The JScript then unbinds all actions from links with .ms-crm-Phone classes and replaces its href-attribute.
This would be useful if one want to override the integrated "Skype / Lync - Click to Dial" feature with his own logic.
I didn't test this method until now, so I can't guarentee it's working !
Note: I will include example scripts as soon I got the time.

ms crm 2015 - set id of entities from jscript onsave

I need to sync entities from Ms Dynamics Crm 2015 - On Premise to my 3rd party application, for this I have set a JavaScript function on the OnSave event of the Entites( eg. account) I can access all of the attributes and send them to my webservice, but the Id (GuId) of the entity!
how can I access the Id (or set it manually) on this event?!
Xrm.Page.getAttribute("accountid") or Xrm.Page.getAttribute("id") both return null, so I can not setValue using them.
Also Xrm.Page.data.entity.getId() returns "" which is probably logical, since Object has not been inserted in the db yet, this is the reason which makes inserting a runtime generated guid for the entety seems doable !
P.S.
I know I can do same thing with plugins, which I have gone through, but the problem there is that when I register my plugin for Update message it gets called a lot of times, (mostly when it has been set for invoice), this is the reason that made me go with the JScript, since the OnSave Event seems more logical than the Update Message of the plugin
As you already found out, records which have not yet been saved have no ID. That's by design (and obvious).
Also, IDs being PKs in the database, they are handled by the system and cannot be touched or hand-crafted.
Your best bet to keep a similar behavior would be a Post-Operation Create plugin living outside the sandbox (Isolation mode: None).
Another good option would be to pull data instead of pushing it: the 3rd party application can periodically fetch new records through any of the exposed APIs (REST, SOAP, SDK ... there are many options).

Resources