Closed shonns closed 4 years ago
You can you just need to include the fetchXml query string parameter in the options:
const options = '?fetchXml=${fetchQuery}'
@derekfinlinson Thank you very much. Can i ask one more question, should WebApiConfig be filled as shown in this example: https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/xrm-tooling/use-connection-strings-xrm-tooling-connect Or in another way?
Thanks for the answer.
No. If you are using the library in a web resource, you only need to pass in the version number for the D365 Web API: const config = new WebApiConfig('9.1')
. If you want to use the library outside CRM, you'll also need to pass in an access token and the organization URL: const config = new WebApiConfig('9.1', tokenFromAdal, 'https://org.crm.dynamics.com)
.
@derekfinlinson, thank you for the information. But if i use Dynamics 365 on-premise i don't have tokenFromAdal, but i need use crm organization service from remote local machine, but i have credentials for crm with admin privilege.
Since this uses the Web API, you'll need to authenticate using OAuth. So that will need to be configured in ADFS if you are using that. If you aren't using that, you might not be able to use this outside D365.
If you want to connect to the Organization Service, you'll need a different library since this only connects to the Web API.
Hi!
As far as I understand in your design there is no method Retrieve Multiple for Soap request with FetchXml parameter. I.e: const options: string = `
retrieveMultiple(config, 'accounts', options) .then( (results) => { const accounts: any[] = []; for (const record of results.value) { accounts.push(record); } console.log(accounts.length); }, (error) => { console.log(error); } );
Thanks for answer.