Closed methodnumber13 closed 5 years ago
Hi @methodnumber13,
Thanks for reaching out.
Can you please try leaving out the "new" in front of the request and not appending the parentheses, so that it looks like this:
let req = webapi.Requests.RetrievePrincipalAccessRequest.with(...)
The requests are not regular classes, they are objects which get their messages and properties by protoypal inheritance.
Kind Regards, Florian
Hi @methodnumber13,
I'll close this issue for now, if above fix does not solve your issue, please reopen again.
Kind Regards, Florian
I'm trying to make request with typescript like this:
try { let req = new webapi.Requests.RetrievePrincipalAccessRequest() .with({ entityName: 'systemuser', entityId: toTrimBrackets(parent.Xrm.Page.context.userSettings.userId), urlParams: { Target:
{"@odata.id": "accounts('${id}')"}` } }); console.log(req); webapi.Execute(req) .then((result: any) => { console.log(result); });and I got this error
Also, I tried to write it like
let req = webapi.Requests.RetrievePrincipalAccessRequest; req.prototype.with({///my code here})
and I got another error Could you provide any samples how I can make my request correctly?P.S.: I have already seen an implementation with JS from this link https://github.com/DigitalFlow/Xrm-WebApi-Client/wiki/Implemented-WebApi-Requests but it's not working in TS