How to use InvalidPluginExecutionException in UCI - dynamics-crm

I use Mscrm 365 on-premise, in my last version (2016) there was a use in InvalidPluginExecutionException function to show the user an error.
In 365 I get the error but not the text I wrote, example in the image.
How can I use the InvalidPluginExecutionException like before and show a message to the user ? if I can't is there an other way or function that I can use ?

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.

Get records in MS flow from Dynamics CRM

I am new to CRM and flow and in building a flow using MS flow, I need to get a record from Dynamics CRM equivalent to below SQL query -
select * from contacts where emailId = '<email id>'
Can you please help me to understand that how can I achieve this. I tried using List records feature but it threw an error that OData query is not correct. Image of flow is attached.
Well, it's working, I just had to put the parameter supplied in the single quote like -
emailaddress1 eq '<Customer email>'
If I understand correctly, the issue you are facing is with Filter query, Flow is not throwing an Error.
I tried to replicate the Flow on my Instance/org.
The issue is see is your filter filed "emailadress" should be selected from CRM i.e from system.
It is not mapped from CRM rather you wrote it per hand.
Click on Filter query it will open the dialog from where you could map the
fields. Screenshot below will help you understand more.

CRM Custom Report

I made a CRM custom report with a custom code and i`m getting an error on the CRM when uploading saying that “The report server has RDLSandboxing enabled and the report contains custom code. Remove the Code element from the report definition.”
Now my question is , Is it possible to disable the RDLSandboxing?
If yes, where do I start?
Here is the code used in the report
Public Function Divider(ByVal Dividend As Decimal, ByVal Divisor As Decimal)
If IsNothing(Divisor) Or Divisor = 0 Then
Return 0
Else
Return Dividend / Divisor
End If
End Function
You can't change anything to the RDL Sandboxing when using CRM Online.
Here are a few links that contain more information on the subject.
RDL Sandboxing for Microsoft Dynamics CRM Online
Custom code that is allowed for use in Microsoft Dynamics CRM Online FetchXML Reports
You will have to change your custom code to any of the accepted Methods & Classes as you have no access to the Report Server
Reports within CRM Online don't allow custom code.
Uploading a report that contains any custom code will generate the error that you're receiving

how to retrieve select option ids and values via the web api

I'm using the api/data/v8.0 API endpoint of a microsoft crm 2016 and I can retrieve and update a specific entity using GET and PATCH on api/data/v8.0/accounts(063e4c86-e7f0-e511-93f7-123456bb6ce7).
That entity has a property called jobtypecode (I can see that on the JSON response of the GET) and on the front end of the CRM the possible values are the following (I retrieved them using dev tools by inspecting that html select):
721874717 Full Time
721874719 Part Time
721874713 Academic
721874714 Other
How can I retrieve those values via the API?
I tried using api/data/v8.0/GlobalOptionSetDefinitions and various combinations of api/data/v8.0/EntityDefinitions but no luck.
You can use EntityDefinitions with the MetadataId of account, add a filter to only get the optionset you want.
EntityDefinitions(70816501-edb9-4740-a16c-6a5efbc05d84)/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet,GlobalOptionSet
Source: https://msdn.microsoft.com/en-us/library/mt607522.aspx#bkmk_queryAttributes

TFS Alert when label is created

Can I configure an alert when a TFS Label is created ? I don't find that option in the current predefined alerts. These are the ones I found:
And I want when a label is created:
Send an email notification.
No, this is not possible using the standard Alert features.
I created my own solution! I don't know how much access you have to your on-premise TFS instance, but you need to be able to execute t-sql scripts against the TFS mssql database. My solution is here: https://github.com/Antebios/tfs-label-notification
And when anyone creates a TFSVC label I get an email alert that looks like this:
Basically, I created a database trigger to populate a table. I query that table and send an email out, then mark the label as sent. I also have a trigger to delete form that table just in case the label gets deleted. I wrote the service in .NET Core just in case anyone wants to convert it to run within a container. Let me know if this helps or not.

Resources