Turn on more accessible mode
Skip Ribbon Commands
Skip to main content
Turn off Animations
SharePoint

Use FetchXML to Retrieve CRM Records

Important StatusThe current page has been customized from its template.
To use FetchXML to retrieve CRM records, complete the following steps:
  1. Check out and open the process you want to edit.

  2. In the Toolbox pane, click Microsoft CRM 4. A list of activities is displayed.

  3. Double-click or drag the Fetch CRM Records into the process.

  4. Link the activity appropriately with other activities in the process.

  5. Right-click the Fetch CRM Records activity. A shortcut menu is displayed.

  6. Click View Properties. The Fetch CRM Records window is displayed.

  7. Click the System Resource tab. The corresponding screen is displayed.

  8. In the CRM System Resource field, click the System Resource editor icon and select the appropriate CRM system resource.

    Note:
    If you select the CRM Entity editor, you can directly select the CRM entity that you want to retrieve.
    If your system resource contains a data item in the connection string property, click Configuration values and enter a valid connection string for design-time, configuration purposes.


  9. Click the Fetch XML tab. The corresponding screen is displayed.

  10. In the Fetch XML field, type the XML code to retrieve the relevant CRM record.

    Note:
    For example, to retrieve CRM accounts and only return the name and account ID, you use the following code:
    <fetch mapping="logical">
    <entity name="account">
    <attribute name="accountid" />
    <attribute name="name" />
    </entity>
    </fetch>
    To use values stored in data items to make your query dynamic, click the Show Data Items button and double-click the relevant data items to insert them into your XML where the cursor is.


  11. Click OK. You configured the activity to use FetchXML to retrieve CRM records. You are now ready to map attributes to data items as documented in the corresponding topics in this section.
Related Topics
Automatically Determine which Data Items to Populate with a CRM Attribute Value
Manually Determine which Data Items to Populate with a CRM Attribute Value
Write the CRM Records to an XML File 

Source
BPM Designer Topics > Overview of Activities and Activity Topics > Microsoft CRM 4 Activities > Fetch CRM Records
Last modified at 7/31/2020 12:06 PM