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

Dynamics 365 Function Parameters (need to remove quote) #931

Open
Slackter opened this issue Mar 29, 2024 · 0 comments
Open

Dynamics 365 Function Parameters (need to remove quote) #931

Slackter opened this issue Mar 29, 2024 · 0 comments

Comments

@Slackter
Copy link

Slackter commented Mar 29, 2024

Hello,

We are utilizing the latest version of this library very heavily without any issues at all so it's been great. We are in need of executing a function and need to specify a function parameter in a very specific format.

The function requires a parameter of Target=@tgt (@tgt can be anything) but there must be NO quotes at all.

If I run use the following code:
client.For<SystemUser>.Key(userGuid).Function("RetrievePrincipalAccess").Set(new { Target = "@tgt })

the library will generate a URL as follows:
https://server/api/data/systemusers(userGuid)/Microsoft.Dynamics.CRM.RetrievePrincipalAccess(Target='@tgt')

when it needs to be:
https://server/api/data/systemusers(userGuid)/Microsoft.Dynamics.CRM.RetrievePrincipalAccess(Target=@tgt)

Is there any way to remove the single quotes the Set() is adding to my URL?

I was able to get this working by using the BuildRequestFor() and modifying the RequestUri directly, but I am unable to write proper unit tests since the ODataRequest has only internal constructors and is un-mockable.

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