Replies: 3 comments 1 reply
-
hi @Notaduck , do you happen to know the full length of the generated URL? Also, is the error coming from Dynamics (if it comes from Dynamics, the error should have a status code and stack trace and etc)? or is it coming from the library? The library converts long URLs into a batch operation. But I wonder if you are hitting the Dynamics 365 url limitation. Also, are you using it in the node.js application? |
Beta Was this translation helpful? Give feedback.
-
I will try to reproduce this error. It looks like it is coming from Dynamics, there is probably a limitation on the url length. this.dynamicsWebApi.startBatch();
//make sure there are no more than 1000 chunks - it is batch operation limitation in Dynamics
//if that happens you can gradually increase the chunk size
if (emailsChunkarr.lengh > 1000) throw new Error("Too many chunks");
emailsChunkarr.map(async (emails) => {
const request: RetrieveMultipleRequest = {
collection: DynamicsCollections.CONTACT,
filter: emails,
count: true,
};
this.dynamicsWebApi.retrieveMultiple<DynamicsContact>(request);
});
const results = await dynamicsWebApi.executeBatch();
const responses =[];
results.forEach(r => responses.push(r.value)); Concerning "in" operator. You have to use this function instead. Here's an example: const response = await dynamicsWebApi.retrieveMultipleRequest({
collection: `accounts`,
filter: "Microsoft.Dynamics.CRM.In(PropertyName=@p1,PropertyValues=@p2)",
queryParams: ["@p1='lastname'", '@p2=["Doe", "2nd Doe"]']
});
// the request will be made to the following url:
// https://<server>?$filter=Microsoft.Dynamics.CRM.In(PropertyName=@p1,PropertyValues=@p2)&@p1=\'lastname\'&@p2=["Doe", "2nd Doe"] |
Beta Was this translation helpful? Give feedback.
-
@Notaduck forgot to tag you in the reply above, not sure if you got the notification. But I also found this: dotnet/runtime#1857 |
Beta Was this translation helpful? Give feedback.
-
Hi Again, so I gave v2 a shot and so far I really enjoy to work with the Library! I was wondering if you have a good idea here.
I'm trying to retrieve multiple contacts at once, however the emailList seems to be to long and I get the following error
Invalid URI: The Uri string is too long.
is there a build in feature to split the list to a more appropriate size? Or do you happen do know how to figure out what the max length is?Beta Was this translation helpful? Give feedback.
All reactions