You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have generated the client based on metadata file downloaded from a vanilla dev instance of Microsoft Dynamics 365 Finance and Operations.
I ticked the option to generate property change tracking, and also "async base" for c# only (not sure what that means precisely. I should also say, I am runnign the version from this PR: #87 as that fixes an issue with spaces being in generated method names.
I wrote a quick console app to new up the client, and post a header record with a related child record, using a single change set.
I haven't managed to get this to work just yet, I have been able to post a header on its own however thats a seperate issue.
Sometimes when I run the app I see this:
Here is how I am using:
varserviceRootUri=newUri($"{url}/data");vardataServiceContext=newResources(serviceRootUri);dataServiceContext.SendingRequest2+=(sender,eventArgs)=>{varrequest=eventArgs.RequestMessage;eventArgs.RequestMessage.SetHeader("Authorization",$"Bearer {token.Token}");};varitem=newMicrosoft.Dynamics.DataEntities.LedgerJournalHeader();// dataServiceContext.AddToLedgerJournalHeaders(item); // in order to use PostOnlySetProperties it seems necessary to use DataServiceCollection instead.varcol=newDataServiceCollection<Microsoft.Dynamics.DataEntities.LedgerJournalHeader>(dataServiceContext);col.Add(item);// after adding the item to the collection, we sets its properties, this is so that change tracking works, and PostOnlySetProperties works.item.DataAreaId="DEMF";item.JournalName="GenJrn";item.Description="Posted by poc";varlinesCol=newDataServiceCollection<Microsoft.Dynamics.DataEntities.LedgerJournalLine>(dataServiceContext);for(inti=0;i<2;i++){varamount=100000;if(i%2==0){}else{amount=-amount;}varline=newMicrosoft.Dynamics.DataEntities.LedgerJournalLine();linesCol.Add(line);// after adding the item to the collection, the following just sets its propertie, this is so that change tracking works, and PostOnlySetProperties works.SetLine(line,item.DataAreaId,item.JournalBatchNumber,amount);dataServiceContext.AddLink(item,nameof(item.LedgerJournalLine),line);dataServiceContext.SetLink(line,nameof(line.LedgerJournalHeader),item);}awaitdataServiceContext.SaveChangesAsync(SaveChangesOptions.BatchWithSingleChangeset|SaveChangesOptions.PostOnlySetProperties);
Assemblies affected
As per above,
Expected result
Wouldn't expect an exception here.
Actual result
Exception thrown when the generated property change handlers are iterated due to some concurrency issue.
Screenshots
As per above.
Additional detail
Add any other context about the problem here.
*Optional, details of the root cause if known.
The text was updated successfully, but these errors were encountered:
Describe the bug
I have generated the client based on metadata file downloaded from a vanilla dev instance of Microsoft Dynamics 365 Finance and Operations.
I ticked the option to generate property change tracking, and also "async base" for c# only (not sure what that means precisely. I should also say, I am runnign the version from this PR: #87 as that fixes an issue with spaces being in generated method names.
I wrote a quick console app to new up the client, and post a header record with a related child record, using a single change set.
I haven't managed to get this to work just yet, I have been able to post a header on its own however thats a seperate issue.
Sometimes when I run the app I see this:
Here is how I am using:
Assemblies affected
As per above,
Expected result
Wouldn't expect an exception here.
Actual result
Exception thrown when the generated property change handlers are iterated due to some concurrency issue.
Screenshots
As per above.
Additional detail
Add any other context about the problem here.
*Optional, details of the root cause if known.
The text was updated successfully, but these errors were encountered: