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

example of request with expand? #60

Open
pixelpaulaus opened this issue May 6, 2021 · 1 comment
Open

example of request with expand? #60

pixelpaulaus opened this issue May 6, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@pixelpaulaus
Copy link

pixelpaulaus commented May 6, 2021

Hello,
I am trying to do a request on an account, and expand some of the account records.
when i communicate with the API via another method/wrapper i have been using, i can do so by adding in:

expand: [{ property: 'property name', select: ['*'] }]

But i am not sure how to add in the expand code for the request:

$retrievedContact = $client->Retrieve( 'account', 'IDHERE', new \AlexaCRM\Xrm\ColumnSet( true ));

could you please provide an example, i want to expand multiple account properties to be retrieved in one request.

@georged georged added the enhancement New feature or request label May 6, 2021
@georged
Copy link
Contributor

georged commented May 6, 2021

@pixelpaulaus

I don't know what another method/wrapper you've been using so I can't comment on that. Can you provide a reference?

We do not provide expand on the Client class level. If you want, you can use OData client (available via $odataClient = $client->getClient() ). OData client includes getRecord method with queryOptions as a parameter; you can assign your expand expression to $queryOptions['Expand'].

public function getRecord( string $entityCollection, string $entityId, array $queryOptions = null ): object {

But then you're on your own to deal with what's coming back.

Having said that, it's not a bad idea. It'd be easy to add that option to the method itself but I think deserialization would need some work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants