Code Monkey home page Code Monkey logo

dynamics-ax-integration's Introduction

dynamics-ax-integration's People

Contributors

bhaarathms avatar christianwolf42 avatar krishnand avatar microsoft-github-policy-service[bot] avatar msftgits avatar nguhoa avatar nimakms avatar rardd1997 avatar srpraveenkumar avatar sushantmu avatar xaak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dynamics-ax-integration's Issues

Dynamics AX integration with Logic App

We are trying to import master data using data packages from Logic Apps action. The master data is huge and we are supplying 200,000 records in the product package and 1000,000 records for customer package. We are using "DataManagementDefinitionGroups-ImportFromPackage" API to import in D365O. Are there any API's available for Logic App to import in bundles to improve the performance similar to "Import in Batch" functionality where it can create multiple threads based on the configurations?

Error when executing query

I'm getting the error below when running the sample code. Am I missing something in the setup?

age":"An error has occurred.","ExceptionMessage":"Forbidden","ExceptionType":"System.ServiceModel.Web.WebFaultException`1[[System.ComponentModel.Win32Exception, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]","StackTrace":" at Microsoft.Dynamics.Ax.Services.ServicesSessionProvider.ThrowSessionCreationException(ServicesSessionCreationErrorCode exceptionCode)\r\n at Microsoft.Dynamics.Ax.Services.ServicesSessionProvider.GetSession(Boolean isILSession, Boolean bypassAuthentication, String issuer, String company, String language, String partitionKey, ClaimsIdentity claimsIdentity)\r\n at Microsoft.Dynamics.Ax.Services.ServicesSessionManager.InitThreadSession(Boolean ilSession, SessionType sessionType, Boolean bypassAuthentication, String authIssuer, String company, String language, String partitionKey, ClaimsIdentity claimsIdentity)\r\n at Microsoft.Dynamics.Platform.Integration.Common.SessionManagement.ServicesAosSessionManager.InitializeSession(Boolean bypassAuthentication, String authIssuerThumbprint, ClaimsIdentity claimsIdentity)\r\n at Microsoft.Dynamics.Platform.Integration.Common.SessionManagement.OwinRequestSessionProvider.CreateSession(ClaimsIdentity claimsIdentity)\r\n at Microsoft.Dynamics.Platform.Integration.Common.SessionManagement.ServicesRequestSessionHelper.EnsureRequestSession(IServicesRequestSessionProvider servicesRequestSessionProvider, ClaimsIdentity claimsIdentity)\r\n at Microsoft.Dynamics.Platform.Integration.Common.SessionManagement.EnsureServicesRequestSessionHandler.EnsureServicesRequestSession(HttpRequestMessage request, IApplicationEnvironment applicationEnvironment)"}"

Microsoft.Dynamics.DataEntities.GetAzureWriteUrl

I am getting the following error while trying import from the Console App and LogicApp samples.

The console app throws the following error..
{"Message":"No HTTP resource was found that matches the request URI 'https://mydevaos.cloudax.dynamics.com/data/DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.GetAzureWriteUrl'. No route data was found for this request."}

Logic App throws the following error..
{
"statusCode": 400,
"headers": {
"Pragma": "no-cache",
"x-ms-request-id": "09a0df9c-3538-433b-9390-8146f4cad4dd",
"Timing-Allow-Origin": "*",
"Cache-Control": "no-cache",
"Date": "Thu, 31 Aug 2017 11:43:33 GMT",
"X-AspNet-Version": "4.0.30319",
"X-Powered-By": "ASP.NET",
"Content-Length": "184",
"Content-Type": "application/json; charset=utf-8",
"Expires": "-1"
},
"body": {
"Message": "Procedure: 'DataManagementDefinitionGroups/Microsoft.Dynamics.DataEntities.GetAzureWriteUrl' is not found.\r\n clientRequestId: 09a0df9c-3538-433b-9390-8146f4cad4dd"
}
}

Can you please help?

Unable to cast object of type 'Microsoft.OData.Edm.BadType' to type 'Microsoft.OData.Edm.IEdmCollectionType'.

Hi There,

I`m unable to build the solution as I get the following error:
Severity Code Description Project File Line Suppression State
Error Running transformation: System.InvalidCastException: Unable to cast object of type 'Microsoft.OData.Edm.BadType' to type 'Microsoft.OData.Edm.IEdmCollectionType'.
at Microsoft.VisualStudio.TextTemplatingEC662FFD71C0FA8F6ACC039AFE7A794F35F761C8B54636650AD72EE4FCC506A4CFBF70E37351EE697543315BD314823A3429BF57EF70F6A0DC082305F7276095.GeneratedTextTransformation.Utils.GetClrTypeName(IEdmTypeReference edmTypeReference, Boolean useDataServiceCollection, ODataClientTemplate clientTemplate, CodeGenerationContext context, Boolean addNullableTemplate, Boolean needGlobalPrefix, Boolean isOperationParameter, Boolean isEntitySingleType) in :line 2802
at Microsoft.VisualStudio.TextTemplatingEC662FFD71C0FA8F6ACC039AFE7A794F35F761C8B54636650AD72EE4FCC506A4CFBF70E37351EE697543315BD314823A3429BF57EF70F6A0DC082305F7276095.GeneratedTextTransformation.ODataClientTemplate.WriteNamespace(String fullNamespace) in :line 1298
at Microsoft.VisualStudio.TextTemplatingEC662FFD71C0FA8F6ACC039AFE7A794F35F761C8B54636650AD72EE4FCC506A4CFBF70E37351EE697543315BD314823A3429BF57EF70F6A0DC082305F7276095.GeneratedTextTransformation.ODataClientTemplate.WriteNamespaces() in :line 1209
at Microsoft.VisualStudio.TextTemplatingEC662FFD71C0FA8F6ACC039AFE7A794F35F761C8B54636650AD72EE4FCC506A4CFBF70E37351EE697543315BD314823A3429BF57EF70F6A0DC082305F7276095.GeneratedTextTransformation.ODataClientTemplate.TransformText() in :line 1201
at Microsoft.VisualStudio.TextTemplatingEC662FFD71C0FA8F6ACC039AFE7A794F35F761C8B54636650AD72EE4FCC506A4CFBF70E37351EE697543315BD314823A3429BF57EF70F6A0DC082305F7276095.GeneratedTextTransformation.TransformText() in :line 93 2802

Can anyone please help me fix this issue.

Regards,

Required privilege for AX7 user

I have received this error if I enter non AX Admin user as AX7 user name.

Enqueue failed for file: xxxxxxx
Failure response: Status: Unauthorized, Reason: Unauthorized.

The error happens at httpClientHelper.SendPostRequestAsync() in processInprocessQueue() method.
I have assigned System administrator role to the account, but it did not solve the issue.
Should we enter AX Admin to AX7 user name?

(Test result)
ID, NetworkAlias
Admin, [email protected] : OK
xxx, [email protected]: NG

Unauthorized using the D365 to Onedrive Logic Apps example

Hello, I have used the D365 to Onedrive example however I am not sure if I need to do any additional to make it work against an add-on environment (Microsoft managed in public cloud). It works fine for sandbox environments in my private subscription however for public cloud I got the message

{
"status": 401,
"message": "{\r\n "Message": "Authentication failed.",\r\n "StackTrace": null,\r\n "ExceptionType": "System.InvalidOperationException"\r\n}\r\nclientRequestId: bcc57362-17ba-429c-9307-815a5aaa931c",
"source": "ft-master-stagingdevaos.sandbox.ax.dynamics.com",
"errors": []
}

I have admin rights in that environments. Any ideas? Thank you.

oDataClient Creation approaching 1 million lines of code

Is there a way to create the odataclient.cs file without having to include every data entity defined in AX365? Our instance, which is new and not customized yet, produces a class file with over 970 thousand lines of code. The size of the file causes Visual Studio crashes and other issues.

Onedrive to D365 badrequest

In step "Initiate package import in D365 for Operations " I got the error

{
"status": 400,
"message": "An error has occurred. Exception occurred while executing action ImportFromPackage on Entity DataManagementDefinitionGroup: Could not find file 'C:\windows\TEMP\673CCCDE-90D8-4AED-84AD-899B662FB071_9AE2CF41-33B4-4D39-94E4-C3D4E2097889\PackageHeader.xml'.\r\nclientRequestId: 5bee9934-6168-48b1-bad7-3efa6cdfc24b",
"source": "XXX.cloudax.dynamics.com",
"errors": []
}

can you help me?

AX7 Data Entities - OData Generator - Combined length of user strings used by the program exceeds allowed limit.

Using the following OData Metadata URL to wrap the Entities in Visual Studio:

https://usnconeboxax1aos.cloud.onebox.dynamics.com/data/$metadata

The OData Generator is able to successfully wrap the entities, however receiving the following error in VS:

Error CS8103 Combined length of user strings used by the program exceeds allowed limit. Try to decrease use of string literals.

My guess is that the generated file is so big VS can't even handle it. I've attempting stripping out entities manually, but that doesn't seem ideal.

Thoughts on a work around?

Processing completed with errors for job:

Hi,

Getting the below error in the Error log file:
{"DataJobStatus":{"DataProject":"XX","DataJobIdentifier":"18e5833c-bbf2-4287-a63b-f8b6dbbbe6ea","ExternalIdentifier":"XX.xlsx","ExecutionIdentifier":"XXImport-2016-08-27T20:58:15-319F6ED28C6D4756AC9F4D4E312DC4F9","DataJobStartedDateTime":"2016-08-27T20:58:15","DataJobCompletedDateTime":"2016-08-27T20:58:15","DataJobState":8},"ExecutionLog":"","ExecutionDetail":null}

Could you also let me know how to configure
"A native client app that has permissions setup for Dynamics Connector APIs.". All i Could see is "Dynamics ERP".

kindly suggest.

Regards
SS

Support for ADAL version 3 : authenticationContext.AcquireToken does not exist anymore

authenticationContext.AcquireToken(aadResource, aadClientAppId, new UserCredential(username, password));

Should be replaced by :
public static async Task GetAuthenticationHeader()
{
...
UserPasswordCredential upc = new UserPasswordCredential("[email protected]", "MYPASSWORD");

       AuthenticationResult authenticationResult = await authenticationContext.AcquireTokenAsync(aadResource, clientAppId, upc);

       return authenticationResult.CreateAuthorizationHeader();
   }

...or any smarter solution that works with ADAL version 3.

System.InvalidOperationException

Hi,
I am getting error in this of code:
private static void ReadLegalEntities(Resources context)
{
Console.WriteLine();
foreach (var legalEntity in context.LegalEntities.AsEnumerable())
{ Console.WriteLine("Name:{0}", legalEntity.Name); }

Error File is about:
An unhandled exception of type ' System.InvalidOperationException' occurred in Microsoft.OData.Client.dll
Additional information: The key property 'Type' on for type
'ProductsApp4.Microsoft.Dynamics.DataEntities.LegalEntityContact' is of
type 'System.Nullable`1[[ProductsApp4.Microsoft.Dynamics.DataEntities.LogisticsElectronicAddressMethodType, ProductsApp4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]', which is not a simple type. Only properties of simple type can be key properties.

AADSTS65001: The user or administrator has not consented to use the application

I get the following error when processing a file...

Failure processing file: CustGroupExp-Customer groups.XML.Exception : AADSTS65001: The user or administrator has not consented to use the application with ID 'a8503097-efd8-47ac-8573-1c039774c3e3'. Send an interactive authorization request for this user and resource.

How would I go about sending an interactive auth request, if that really is the solution. Any ideas @nimakms?

Referenced assembly issue for ODataConsoleApplication

Please update the references in ODataConsoleApplication.csproj the version and the path of odata dlls (client, core and Edm) it must be defined like this otherwise the application will not run:

..\packages\Microsoft.OData.Client.6.15.0\lib\net40\Microsoft.OData.Client.dll True ..\packages\Microsoft.OData.Core.6.15.0\lib\portable-net45+win+wpa81\Microsoft.OData.Core.dll True ..\packages\Microsoft.OData.Edm.6.15.0\lib\portable-net45+win+wpa81\Microsoft.OData.Edm.dll True ..\packages\Microsoft.Spatial.6.15.0\lib\portable-net45+win+wpa81\Microsoft.Spatial.dll True

OdataConsoleApplication error when calling ReadLegalEntities

Hi,
I'm using Odata client 6.15 and D365FO application version 8.0.
When calling method ReadLegalEntities I am getting an error on line foreach (var legalEntity in d365.LegalEntities.AsEnumerable()):

System.InvalidOperationException was unhandled
HResult=-2146233079
Message=The key property 'AliasType' on for type 'ODataUtility.Microsoft.Dynamics.DataEntities.LedgerAccountAlias' is of type 'System.Nullable`1[[ODataUtility.Microsoft.Dynamics.DataEntities.DimensionAliasType, ODataUtility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]', which is not a simple type. Only properties of simple type can be key properties.

I am able to get the total number of legal entities or vendors but I can't loop through the IEnumerable to get legal entity names.
Any ideas?

Cheers,
Vincent

Composite entities dataset failing error

When trying to upload composite entity packages, the package doesn't run and failed on AX with the next error:
A DataTable named 'PurchaseOrderV2Entity' already belongs to this DataSet.
'0' 'Purchase orders composite V2' record(s) inserted in staging.

Manually from dynamics 365 environment import data management we don't get that error.

Remove Role Organization using OData

Hi there,

Here i want to remove the role organizations through OData in HTTPWebResponse . But unfortunately, i can't able to remove. The HttpWebRequest responded like "No Http Method was found" HTTP 404 Exception thrown.

How to parse the response from insert?

I'm using the MS sample code to create a journal using OData.
I can create the header fine.
However, when the header is created, the journal number is returned in the response.
How do I get the journal number from the response?

The record is created using
resp = context.SaveChanges();

resp is of type DataServiceResponse, and contains the data in Json format (if I understand this correctly) - but I'm having trouble pulling gout the one field with the new journal ID.
How do I get the new journal ID from the response?

System.IO.FileLoadException

Exception on line 75 of DefaultDataFlowNetwork.cs:

An exception of type 'System.IO.FileLoadException' occurred in RecurringIntegrationApp.exe but was not handled in user code

Additional information: Could not load file or assembly 'Microsoft.Dynamics.AX.Framework.Tools.DataManagement.Serialization, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

ODataServices timeout on call to ExportToPackage

On calling ExportToPackage for a standard data project outputting to Excel, the call to ExportToPackage does not return immediately, but sits for a period before then timing out. I can confirm that the job execution id has been generated and the request is processing.

image

How can we get Microsoft.Dynamics.AX.Framework.Tools.DataManagement.Serialization to prevent this error?

I received this error when running this sample program on my server using VS2015.
What should I install on the machine where this program runs to prevent this error?

(Error)
An exception of type 'System.IO.FileLoadException' occurred in RecurringIntegrationApp.exe but was not handled in user code
Additional information: Could not load file or assembly 'Microsoft.Dynamics.AX.Framework.Tools.DataManagement.Serialization, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

We are using AX Data job Processor the URL is pointed towards Production BOX(we are running this from DEV Box).

When we drop the file in the input path, the file is processed and moved into In process folder.

After that we are not getting response from the production server. getting the below stated error.
"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
This happens only in production box, works fine in dev and sandbox.

Kindly help us to resolve this issue.

Exception : AADSTS50001: Resource 'xxx.aos.cloudax.dynamics.com' is disabled

Hi,

I'm getting the below mentioned error:
File - Customers.csv - found in input location. Initializing data processing sequence...
File: Customers.csv - moved to inprocess location.
Enqueueing job: Customers.csv. File size: 29016 bytes.
Failure processing file: Customers.csv.Exception : AADSTS50001: Resource 'https://'xxx.aos.cloudax.dynamics.com' is disabled.
Trace ID: c3e77d09-e2db-46e7-bf42-47eeb32b1d00
Correlation ID: 4fdf7262-ee67-4a99-836e-a4de7fb19411
Timestamp: 2017-08-07 08:49:43Z

Kindly let me know, how to rectify this error.

Recurring Data Job stuck 'in process'

I have the setup working, the file is being pushed into the queue and the recurring batch job is kicking off.
However, the job gets stuck with status 'in process'
How/where can I see what the issue is? Is there any type of log I can review.
The Integration app just keeps trying to check for status "Checking enqueued jobs' status"

Dynamic generation of oDataClient code

After changing .NET target to 4.6.1, using TLS1.2, removing misplaced space in the metadata document and renaming duplicated entity names to allow generation to work in Visual studio, here's where I stand now.

1 - The template generated oDataClient cause crashes in Visual studio and it needs to be regenerated manually.

2 - Automation of the template generation using ITextTemplatingEngineHost does not work well, it gives an empty path exception in .NET code.

3 - Usage of EntityClassGenerator returns this error "The required attribute 'Relationship' is missing."
Since It works for the Dynamics NAV oData endpoint, I was under the impression this was the best way to generate the oDataClient code. I'm still not sure if it supports latest oData version...

I read somewhere that the DAX365 metadata may be broken, it is the case?

So I don't know what else to try,
Any suggestions would be appreciated.

Thanks a lot!

Unauthorized issue while running DIXFSampleSolution

Hi,
I am getting the following issue while running the RecurringIntegrationApp
StatusCode: 401, ReasonPhrase: 'Unauthorized', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:

Any resolution to this please?

Thanks,
Kiran

Error SOAP

Hi,

I received this error, what is the possible issue?
image

authority_not_in_valid_list error

I'v entered UriString/UserName/Password/ADResource/ADTenant/ADClientAppId in the ClientConfiguration,

When I run the JsonConsoleApplication I get the following error:
Additional information: authority_not_in_valid_list: 'authority' is not in the list of valid addresses

Exception has been thrown by the target of an invocation.

Hi Team,

Iam currently working on OData services. I have created a custom field "Container" data type in "Custtable" and added it to the Customer entity. When I tried to update the field "Container" using OData it throws the below error. Please provide me a valuable solution. This is high critical for us. Kindly help me out.
{
"error":{
"code":"","message":"An error has occurred.","innererror":{
"message":"Exception has been thrown by the target of an invocation.","type":"System.Reflection.TargetInvocationException","stacktrace":" at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataEntityDeserializer.ReadODataBodyAsType(HttpRequestMessage request, Type clrType)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataEntityDeserializer.ReadODataBodyAsDelta(HttpRequestMessage request, Type clrType)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataController.ReadBodyAsDelta(EntityType entityType)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataController.ReadBodyAsDelta(RequestEntityInfo requestEntityInfo)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataController.Patch()\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClassc.b__6(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__181.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Tracing.ITraceWriterExtensions.d__181.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Tracing.Tracers.HttpControllerTracer.<ExecuteAsyncCore>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__181.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()","internalexception":{
"message":"Exception has been thrown by the target of an invocation.","type":"System.InvalidOperationException","stacktrace":" at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataEntityDeserializer.ReadODataBody[T](HttpRequestMessage request)"
}
}
}
}

Batch Update using OData service context

Hi,
The below code does the batch insert in D365O
context.SaveChanges(SaveChangesOptions.PostOnlySetProperties|SaveChangesOptions.BatchWithIndependentOperations);

Is there any option for Batch Update using the OData service??

NullReferenceException was unhandled by user code (DefaultDataFlowNetwork.cs line75)

System.NullReferenceException was unhandled by user code
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=RecurringIntegrationApp
StackTrace:
at RecurringIntegrationApp.AuthenticationHelper.get_AuthorizationHeader() in C:\D365O\Projects\Dynamics-AX-Integration-master\DIXFSamples\RecurringIntegrationApp\Helpers\AuthenticationHelper.cs:line 25
at RecurringIntegrationApp.AuthenticationHelper.GetValidAuthenticationHeader() in C:\D365O\Projects\Dynamics-AX-Integration-master\DIXFSamples\RecurringIntegrationApp\Helpers\AuthenticationHelper.cs:line 63
at RecurringIntegrationApp.HttpClientHelper.d__1.MoveNext() in C:\D365O\Projects\Dynamics-AX-Integration-master\DIXFSamples\RecurringIntegrationApp\Helpers\HttpClientHelper.cs:line 75
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at RecurringIntegrationApp.DefaultDataFlowNetwork.<getStatus>d__26.MoveNext() in C:\D365O\Projects\Dynamics-AX-Integration-master\DIXFSamples\RecurringIntegrationApp\Runtime\DefaultDataFlowNetwork.cs:line 312 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at RecurringIntegrationApp.DefaultDataFlowNetwork.d__24.MoveNext() in C:\D365O\Projects\Dynamics-AX-Integration-master\DIXFSamples\RecurringIntegrationApp\Runtime\DefaultDataFlowNetwork.cs:line 187
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at RecurringIntegrationApp.DefaultDataFlowNetwork.<<-ctor>b__17_0>d.MoveNext() in C:\D365O\Projects\Dynamics-AX-Integration-master\DIXFSamples\RecurringIntegrationApp\Runtime\DefaultDataFlowNetwork.cs:line 75
InnerException:

“The underlying connection was closed: An unexpected error occurred on a send.”

I'm using some of the sample code to automatically upload XML files to a custom entity.
Everything works great when I'm running the code on the actual AOS that hosts the OData endpoint.
However, if I try to access the OData endpoint on another server I get error “The underlying connection was closed: An unexpected error occurred on a send.”
I can't really find any other errors/details. I confirmed that I can access the OData endpoint from the server I run the code from via the browser - the appID is also setup poperly.
Any idea what the issue can be ?

Javascript integration from browser

Please provide a sample Javascript application for integrations to Dynamics 365 For operations and documentation, along side with this github project,
Partners and customers need to be able to query OData and webservices from within a webbrowser, with quick authentication and no CORS issues

Thanks

File is being picked up while still being copied by user (DIXF)

We ran into a problem where the tool would pick up a file from the input folder while the copy process had not yet completed.

I implemented the code below in the file processor class to fix this.

private void sharedFolderFileCreatedHandler(object source, FileSystemEventArgs e)
{
form.logText("File - " + Path.GetFileName(e.FullPath) + " - found in input location.");

        // ITK - RvB - 2017_11_23 -->
        // Prevent the file being picked up while it is still being copied by the user
        if (this.IsFileReady(e.FullPath) == true)
        {
        // ITK - RvB - 2017_11_23 <--

            Task.FromResult(this.DataNetworkStrategy.PostMessageAsync(
                new ClientDataMessage()
                {
                    Name = Path.GetFileName(e.FullPath),
                    FullPath = e.FullPath,
                    MessageStatus = MessageStatus.Input
                }));

        }   // ITK - RvB - 2017_11_23 <--
    }

    // ITK - RvB - 2017_11_23 -->
    // Make sure file is not in use
    private bool IsFileReady(String sFilename)
    {
        // If the file can be opened for exclusive access it means that the file
        // is no longer locked by another process.
        bool isReady = false;

        while (isReady == false)
        {
            System.Threading.Thread.Sleep(500);
            try
            {
                using (FileStream inputStream = File.Open(sFilename, FileMode.Open, FileAccess.Read, FileShare.None))
                {
                    if (inputStream.Length > 0)
                    {
                        isReady = true;
                    }
                    else
                    {
                        isReady = false;
                    }

                }
            }
            catch (Exception)
            {
                isReady = false;
            }
        }
        return true;
    }
    // ITK - RvB - 2017_11_23 <--

DataServiceQueryException

I am having an issue with getting data from the application. Authentication with my credentials is going fine and an authentication header is being created and sent. However, when data is being gathered from AX an unauthorized exception is thrown:

foreach (var legalEntity in context.LegalEntities.AsEnumerable())
{
Console.WriteLine("Name: {0}", legalEntity.Name);
}

an error is being thrown - Exception thrown: 'Microsoft.OData.Client.DataServiceQueryException' in Microsoft.OData.Client.dll

Inner Exception details -

Exception thrown: 'Microsoft.OData.Client.DataServiceQueryException' in Microsoft.OData.Client.dll
Microsoft.OData.Client.DataServiceClientException: Unauthorized
at Microsoft.OData.Client.QueryResult.ExecuteQuery()
at Microsoft.OData.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, QueryComponents queryComponents)

Any ideas of a solution to this please?

Thanks,
Matt

use Data Entity action to send json from javascript

I am trying to send json object to data entities's action. However the data entity action seems to only accept the primitive types. What I want to do is send json object or stringify json object so I don't have to have hundreds of parameters in data entity action. Is it possible? Every time I try to send the json object it just gives me 500 error

Data Entity =============================
[SysODataActionAttribute("SaveRsrcTimeList", false),SysODataCollectionAttribute("return", Types::Record, "RsrcTimeEntity")]
public static List SaveRsrcTimeList(str param)
{
}

Javascript side =============================
`let test = {
"param": {
"Name": "John Done",
"SchedRsrcType": "SchedRsrcType"
}
};

    $.ajax({
        url: "/data/RsrcTimeCollection/Microsoft.Dynamics.DataEntities.SaveRsrcTimeList",
        type: "POST",            
        contentType: "application/json; charset=utf-8",
        data: JSON.stringify(test),
        success: function () {
            alert("Server call has been OK!!");
        },
        error: function () {
            alert("Server call has been failed!!");
        }
    });`

Integration between the Dynamic Finance and Operation ERP(AX) and other endpoint:

I have created Dynmic AX trail portal using https://trials.dynamics.com/Dynamics365/Signup/operations, My trail AX portal points "https://d365try-46.trial.operations.dynamics.com/namespaces/3a628bf5-5c84-44d1-bdf6-442861a25d40/"

Now, Need do the integration between the my trail to other end point. I have created a OAuth App at Azure portal, Using that app, am able to get the Access token. But when try to access API using that accesstoken am getting 404 error. I tried two ways to get the access token. But both the ways failed to access the API

I follwoed the AX API DOC https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/data-entities/odata?toc=/fin-and-ops/toc.json

  1. Access token using resource as "https://api.trial.operations.dynamics.com"
    {
    "token_type": "Bearer",
    "scope": "AX.FullAccess CustomService.FullAccess Odata.FullAccess",
    "expires_in": "3600",
    "ext_expires_in": "0",
    "expires_on": "1524457722",
    "not_before": "1524453822",
    "resource": "https://d365try-46.trial.operations.dynamics.com",
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkZTaW11RnJG

    When i access API https://d365try-46.trial.operations.dynamics.com/data/Customers i got 404 status code

  2. Access token using resource as "https://api.trial.operations.dynamics.com"
    {
    "token_type": "Bearer",
    "scope": "AX.FullAccess CustomService.FullAccess Odata.FullAccess",
    "expires_in": "3599",
    "ext_expires_in": "0",
    "expires_on": "1524220794",
    "not_before": "1524216894",
    "resource": "https://api.operations.dynamics.com",
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik

    When i access API https://api.operations.dynamics.com/data/Customers I could not get any response.

According to the API Doc, endpoint like "[Your organization's root URL]/data/Customers"

Here what should i use as url and also please share the AX API doc link

Data Package generation

How do you generate a Data Package for import?
Is there a guide or tool for this?

In the FileBasedIntegrationSamples/ConsoleAppSamples/DataPackageHandler/SampleData/ folder there is a sample DataPackage. Is there a way to generate something similar outside D365FO?

How to read and write customized data entity

Hi,

I have used the code and it is working fine. Issue is I am not able to read customized Data Entities and customized fields of standard Data Entities. Can you please help with the code to read and write the customized elements?

Change language URI

Is there a way to change the language in the URI of the HTTP request?
My client wants to receive the validation/error messages in a different language.

Thanks.

Assembly reference missing!

using ODataUtility.Microsoft.Dynamics.DataEntities

The above line causes an assembly reference error. Am I missing something?

ODataClient generation

When generating a new ODataClient (by changing the pointed to MetadatDocumentUri) I received the following error:

Running transformation: System.InvalidCastException: Unable to cast object of type 'Microsoft.OData.Edm.Csdl.CsdlSemantics.UnresolvedType' to type 'Microsoft.OData.Edm.IEdmCollectionType'.

No new ODataClient is create.
I’m at a loss about what to do to fix this. Have tried updating the nugget packages and creating a new OData Client object in the project.

A single hit on google (https://stackoverflow.com/questions/32727022/unable-to-cast-object-of-type-microsoft-odata-edm-csdl-csdlsemantics-unresolved) mentions the same error, but the provided fix does not solve my issue.

OData Client T4 Template ver. 7.5.0 fails to run with Microsoft.VisualStudio.TextTemplating.Engine

Here's the stack trace:

An exception was thrown while trying to compile the transformation code. The following Exception was thrown:
System.ArgumentException: Empty path name is not legal.
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Roslyn.Utilities.FileUtilities.OpenFileStream(String path)
at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation)
at Microsoft.VisualStudio.TextTemplating.CompilerBridge.<>c.<.ctor>b__15_0(String x)
at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Linq.Enumerable.<UnionIterator>d__671.MoveNext()
at System.Linq.Enumerable.d__671.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable1 items) at Microsoft.CodeAnalysis.ImmutableArrayExtensions.AsImmutableOrEmpty[T](IEnumerable1 items)
at Microsoft.CodeAnalysis.Compilation.ValidateReferences[T](IEnumerable1 references) at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.WithReferences(IEnumerable1 references)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonWithReferences(IEnumerable1 newReferences) at Microsoft.VisualStudio.TextTemplating.CompilerBridge.PrepareNewCompilation() at Microsoft.VisualStudio.TextTemplating.CompilerBridge.Compile() at Microsoft.VisualStudio.TextTemplating.TransformationRunner.Compile(String source, String inputFile, IEnumerable1 references, Boolean debug, SupportedLanguage language, String compilerOptions)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.