Quantcast
Channel: Jason Lattimer's Groups Activities
Viewing all 869 articles
Browse latest View live

Can we connect to MSCRM through token instead of user name and password using Microsoft SDK

$
0
0

Hi,

I am able to connect MSCRM through C# .Net application with User Name , Password and Organisation URL,

ClientCredentials credentials = new ClientCredentials();
credentials.UserName.UserName =xyz;
credentials.UserName.Password = abcd213;
Uri serviceUri = new Uri('xyz.api.dynamics.com/.../Organization.svc');
OrganizationServiceProxy proxy = new OrganizationServiceProxy(serviceUri, null, credentials, null);
proxy.EnableProxyTypes();'
_service = (IOrganizationService)proxy;

 

Can I connect same with oauth2 token instead of User Name and password using Microsoft SDK?

Thanks in advance!


How do I add a default project based line item to an order?

$
0
0

Hello,

Could someone point me in the right direction, please? I'd like to add a default project based line item to any work-based order.  Where do I create the record using a workflow?  These don't bring up the form I get when I add something manually:  Project Contract Line Detail, Order.

Thanks!

How to Read Microsoft CRM online reports data using Rest API

service.Create Sometimes takes abruptly longer to execute

$
0
0

Hi All,

I have a plugin to create a case synchronously with certain attributes. On an average, the service.create call takes around ~2-3 Seconds to execute. But few times it takes 10-20 seconds to execute the same call with similar number of attributes.

Has anyone experienced this behavior before? Please suggest in case you've any thoughts on this problem.

Thanks,

Meet

Stop record creation from Pre-validate Plugin without throwing exception

$
0
0

Hello Techies, 

I have a pre-validate plugin for duplicate detection.

based on the criterion if there is duplicate records found, I want to stop the record creation without throwing the Invalid Plugin Execution Exception.

Thanks in Advance. 

Viswa

looking for a tool to run to have it check for depreciated client api

$
0
0

I am currently on CRM 2016 and I read that some APIs are being depreciated when upgrading to 365.  Is there a tool that I can run to have it check all of my scripts for those depreciated APIs instead of going through them individually?

Thank you.

How to integrate the validation before cancel the sales order

$
0
0

I would like to do some validation part before cancelling the Sales Order.  I have created a plug-In for adding validation and calling this plug-In when "Cancel Order" button clicked.  If the validation is not satisfied,  I am throwing an error message by throwing an exception.  It's working fine. But the "Cancel Order" dialog box is opening when clicking "Cancel Order".  Eventhough it's throwing error message,  if I closed error message,  the dialog box still open only.  They can able to "Cancel Order".  Before "Confirm" the cancel order, whether can I integrate order cancelling. 

Talking to Dynamics CRM Online thru Web API

$
0
0

I'm trying to create a new contact (proof of concept) thru web api, but om getting 401 Unauthorized. I'll post my code below:

try
{
    var jsonStr = "{ \"firstname\": \"Test\", \"lastname\":\"API\" }";

    string username = "lars@foo.onmicrosoft.com";
    string password = "qwert1234";
    string domain = "foo.onmicrosoft.com";
    string baseAddress = "https://foo.crm4.dynamics.com";

    byte[] credentialBuffer = new UTF8Encoding().GetBytes(username + ":" + password);

    var request = (HttpWebRequest)WebRequest.Create(baseAddress + "/api/data/v9.1/contacts");
    request.Method = "POST";
request.ContentType = "application/json"; request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(credentialBuffer));  request.Headers.Add("OData-MaxVersion", "4.0"); request.Headers.Add("OData-Version", "4.0"); using (var stream = request.GetRequestStream()) { var jsonStrBytes = Encoding.ASCII.GetBytes(jsonStr); stream.Write(jsonStrBytes, 0, jsonStrBytes.Length); } var response = (HttpWebResponse)request.GetResponse(); var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd(); } catch (Exception ex) { }

But from this I get 401 Unauthorized. This is Dynamics CRM Online and my user is a 365 user. What am I missing here?


D365 Developer Extensions

$
0
0

I am trying to install D365 Developer Extensions for CRM dynamics plug-in projects. As this is not published Microsoft, our IT security does not allow us to use this. Do you have any workaround/Microsoft authorized extensions that I can use. 

marketplace.visualstudio.com/items

Thanks,

Raj

can i set CRM to log automatically at same time evry day

$
0
0

I want to know if we can set the application to log  in CRM at the same time everyday

Use Xrm.WebApi in a stand alone Web Resource

$
0
0
I ran into this issue working on the last update to CRM REST Builder when adding the Xrm.WebApi functionality. Note this won’t effect you if you’ve got a web resource embedded in a form.

Attempting to execute a simple retrieve for example:
Xrm.WebApi.online.retrieveRecord("account"…
And I was greeted with this error:

Unexpected token u in JSON at position 0

What does that even mean? I bit of searching and I ran across this Stack Overflow question. So it seems Xrm.WebApi is looking for a variable which maps entity names with their corresponding entityset names. Easy fix since I had all the data so I dynamically built a variable with all the mappings which looked a bit like this (you only need to add the entities you're working with):
window["ENTITY_SET_NAMES"] = ['{"account":"accounts", "contact":"contacts"}'];
Got further along and started working implementing actions and functions and ran into the same error once again, WTF. After some tedious debugging through the Microsoft code I found there is another dependency on a similar variable. This one maps entities to their primary id fields. So I added something like this with all these mappings:
window["ENTITY_PRIMARY_KEYS"] = ['{"account":"accountid", "contact":"contactid"}'];
After that my problems were solved.

Visual Studio 2017 - Dynamics 365 SDK cant connect to server

$
0
0

1. I downloaded the Developer extensions and the developer toolkit. (vsix for dynamics)

2. Updated the manifest with the version 15 instead of the 14.

3. Got both installations completed 

4. Instead of map the folders installed I mapped the path to the most recent version of dlls.

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/download-tools-nuget

And now I cant make the connection. When I tried to start a new project I get the window that asks if you want to reconnect to crm and it shows my server: organization: and user: do you want to use this connection I click yes and then I get this error:

Dynamics 365 Trial

$
0
0

Hi,

Hopefully someone can help - I have registered for a Dynamics 365 trial version - I was hoping to explore creating workflows etc - but I am not an administrator so can't do this.  When I try to update my user it fails.  Can anyone help.

thanks

Steven

Log Azure DevOps Build Times to Application Insights

$
0
0
I’ve been working a lot with Azure DevOps recently to automate Dynamics 365 CE deployments. One of the first things I noticed was that using the hosted build agents resulted in slower builds than I was used to, comparatively speaking anyway to performing the same operations on your local machine. It’s not surprising given that for each build the agent is spun up and torn down and nothing can be re-used from previous runs. Whereas on your local machine NuGet packages are already downloaded, any build tools are already installed, etc. so naturally it’s way faster. Building a simple plug-in and running a few unit tests was taking close to 2 minutes. Which is fine I guess considering rarely would anyone be staring at it waiting for it to finish. The thought though was that once you started building real projects with lots of unit tests the build could end up taking quite a long time to finish, potentially backing up other processes. I figured it would be a good idea to keep an eye on how long they’re taking by showing the average time for a build on a dashboard in hopes that it would draw attention if the times started getting long without anyone really noticing. I checked the Visual Studio Marketplace but didn’t find any existing tools to handle this so I thought I’d put one together using Application Insights to store the data. There was already a free dashboard widget available which could surface that data so I figured it would be the easiest route to take.

I wanted to log the time at the end of the build (knowing the results will be off a few seconds) as opposed to relying on some other process like a Web Hook / Azure Function combination. I decided to use a PowerShell task as the last step of the build to do the logging.

Have a look.


Here’s a quick rundown on what the code is doing.

Initial portion if calculating the number of minutes based on when the build started and when the code ran. I’m using one of the predefined variables called System.PipelineStartTime to establish the start. I’m not actually sure that’s documented anyplace as far as I can tell but if you were to do a dump of all the system variables it shows up. The number of minutes you end up with is relatively close to what is reported if you looked at the completed build in the UI, give or take 6-10 seconds. I figured that was an acceptable margin for error since you’d probably never look to optimize a build if you were only going to gain a few seconds.

You’ll need to provide the Instrumentation Key for your Application Insights instance so there’s a basic check to make sure that was provided. Of course store that in a Variable Group or at a Build Variable instead of hard coding to make changing it easy. There’s also the side benefit of hoping that nobody trolls my GitHub account because I had example code with hard coded credentials to simplify things for those people who are still learning. :)

I chose to use the Metric type in Application Insights to record the data being that it’s numeric in nature. You can see the JSON body of the request that is going to be made, most of it is the boilerplate request. There are two places where you can make changes to the data being sent. Under ‘metrics’ the ‘name’ can be changed to anything you’d like. I used “Build Time” to describe the type of metric being recorded and the the build definition name so I knew which build it came from. You could make it anything but be aware that this is used for aggregation so you won’t want any dynamic values here. The other place is under ‘properties’. Those can be any key/value pairs you want, so if you want to capture detail about the build agent, values from the predefined build variables, or something else entirely you can put it here and you’ll be able to query on it in Application Insights.

Finally is gives a check to see if the request was successful. It certainly doesn’t hurt to be verbose with the logging. Trying to debug failed builds when you have to wait 2+ minutes between runs is painful so do yourself a favor and do whatever you can to speed that process up.

Another quick note, I’m using 2 different formats when referencing variables and that is on purpose. The majority are in the format like $(Build.DefinitionName) but the instance where where the pipeline start time is used it’s in the format like $Env:System_PipelineStartTime. The reason being is that I have this script in a Task Group (which basically combines multiple steps into 1 that can be reused) and by default it will scan through all the variables you’re using and turn them into parameters. In this case I want the value to be retrieved at run time instead. I could have jumped though a few hoops and exported and reimported the task group after editing by hand but I figured out that just using $Env: instead causes it to be skipped when parameters are gathered.

In a future post I’ll walk through getting the information on an Azure DevOps dashboard.

Can we connect to MSCRM through token instead of user name and password using Microsoft SDK

$
0
0

Hi,

I am able to connect MSCRM through C# .Net application with User Name , Password and Organisation URL,

ClientCredentials credentials = new ClientCredentials();
credentials.UserName.UserName =xyz;
credentials.UserName.Password = abcd213;
Uri serviceUri = new Uri('xyz.api.dynamics.com/.../Organization.svc');
OrganizationServiceProxy proxy = new OrganizationServiceProxy(serviceUri, null, credentials, null);
proxy.EnableProxyTypes();'
_service = (IOrganizationService)proxy;

 

Can I connect same with oauth2 token instead of User Name and password using Microsoft SDK?

Thanks in advance!


How do I add a default project based line item to an order?

$
0
0

Hello,

Could someone point me in the right direction, please? I'd like to add a default project based line item to any work-based order.  Where do I create the record using a workflow?  These don't bring up the form I get when I add something manually:  Project Contract Line Detail, Order.

Thanks!

How to Read Microsoft CRM online reports data using Rest API

service.Create Sometimes takes abruptly longer to execute

$
0
0

Hi All,

I have a plugin to create a case synchronously with certain attributes. On an average, the service.create call takes around ~2-3 Seconds to execute. But few times it takes 10-20 seconds to execute the same call with similar number of attributes.

Has anyone experienced this behavior before? Please suggest in case you've any thoughts on this problem.

Thanks,

Meet

Stop record creation from Pre-validate Plugin without throwing exception

$
0
0

Hello Techies, 

I have a pre-validate plugin for duplicate detection.

based on the criterion if there is duplicate records found, I want to stop the record creation without throwing the Invalid Plugin Execution Exception.

Thanks in Advance. 

Viswa

looking for a tool to run to have it check for depreciated client api

$
0
0

I am currently on CRM 2016 and I read that some APIs are being depreciated when upgrading to 365.  Is there a tool that I can run to have it check all of my scripts for those depreciated APIs instead of going through them individually?

Thank you.

Viewing all 869 articles
Browse latest View live