Hi
I have this code that is supposed to get entity metadata but it returns a 404.
const metas = {},
requests = [];
entities.forEach(e => {
requests.push({
EntityFilters: 2,
LogicalName: e,
RetrieveAsIfPublished: false,
getMetadata() {
return {
boundParameter: null,
operationType: 1,
operationName: "RetrieveEntityRequest",
parameterTypes: {
EntityFilters: {
typeName: "Microsoft.Dynamics.CRM.EntityFilters",
structuralProperty: 0
},
LogicalName: {
typeName: "Edm.String",
structuralProperty: 1
},
RetrieveAsIfPublished: {
typeName: "Edm.Boolean",
structuralProperty: 1
}
}
};
}
});
});
console.log(`Requests: ${JSON.stringify(requests)}`);
const result = await context.webAPI.executeMultiple(requests),
json = result && (await result.json());
console.log(`JSON: ${JSON.stringify(json)}`);
Looking at the network traffic I noticed that EntityFilters is undefined and getMetadata is null. Any help is appreciated, thanks!
--batch_1576117091198 Content-Type: application/http Content-Transfer-Encoding: binary GET /api/data/v9.0/RetrieveEntityRequest(EntityFilters=@EntityFilters,LogicalName=@LogicalName,RetrieveAsIfPublished=@RetrieveAsIfPublished,getMetadata=@getMetadata)?@EntityFilters=undefined&@LogicalName='account'&@RetrieveAsIfPublished=false&@getMetadata=null HTTP/1.1 Accept: application/json Prefer: odata.include-annotations="*" --batch_1576117091198 Content-Type: application/http Content-Transfer-Encoding: binary GET /api/data/v9.0/RetrieveEntityRequest(EntityFilters=@EntityFilters,LogicalName=@LogicalName,RetrieveAsIfPublished=@RetrieveAsIfPublished,getMetadata=@getMetadata)?@EntityFilters=undefined&@LogicalName='contact'&@RetrieveAsIfPublished=false&@getMetadata=null HTTP/1.1 Accept: application/json Prefer: odata.include-annotations="*"