Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch create not working (on-prem) #104

Open
hvdeath opened this issue Jan 8, 2021 · 0 comments
Open

Batch create not working (on-prem) #104

hvdeath opened this issue Jan 8, 2021 · 0 comments

Comments

@hvdeath
Copy link

hvdeath commented Jan 8, 2021

When you try to create multiple item in one Create (batch) it throws the following exception:

 System.ArgumentException : Invalid 'HttpContent' instance provided. It does not have a content type header starting with 'multipart/'.
    Parameter name: content

I downloaded and tried to ran the built in tests and it also failed (BasicCRUDTests.TestMethod1) with the same.

I set up CRMWebAPI with the following code (for test):
CRMWebAPI api = new CRMWebAPI("https://crm/D365DEV/api/data/v9.0/", new NetworkCredential("username", "pass", "domain"));

And run the following:
List<object> batchList = new List<object>(); for (int i = 0; i < 5; i++) { dynamic batchCreateData = new ExpandoObject(); batchCreateData.name = "test " + DateTime.Now.ToString(); batchList.Add(batchCreateData); } Results.CRMBatchResult batchResults = await api.Create("accounts", batchList.ToArray());

I saw the code and this method created its own HttpClient which do not take care of on-prem scenario.

Is there any chance to fix it? (or maybe I can create a PR, but I saw that the code didn't change a while...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant