AleksandrRogov / DynamicsWebApi

DynamicsWebApi is a Microsoft Dataverse Web API helper library for JavaScript & TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with unbound function parameters

dantol1 opened this issue · comments

Hi, I was trying to make an unbound function call and add a guid parameter, but I kept receiving and error "Expression of type 'Edm.String' cannot be converted to type 'Edm.Guid'." I looked at the code and it looks like the buildFunctionParameters wraps the parameter in '' which is the cause of this issue, is there a way to avoid it being added? or should I open a PR with a purposed fix?

Possible problematic code for reference:

the function I want to use is:
RetrieveAadUserRoles

Verified with another function that guid shouldn't be wrapped in ''

additional function that fails with guid:
RetrieveAadUserSetOfPrivilegesByNames

so a fix should be fairly simple (make sure it's not a guid before wrapping with '') unless there is already a solution that I missed.

hi @dantol1 ,
yes, you are right, this is a bug. and yes, the solution should be fairly straight forward. I already have a similar check for alternate keys and I will apply the same one to the function parameters.

hi @dantol1 ,

Published a patch v.1.7.9. It should be live on NPM. Let me know if you have any further issues with it.

P.S. Forgot to thank you for reporting it. Thank you!

Amazing it works perfectly now! Thanks a lot!