@CRMUG Technical Academy Fetch Xml Were can Fetch Xml be used Basic Fetch Xml and using advanced find to build your own Fetch Query Creating Fetch Xml.

Slides:



Advertisements
Similar presentations
Microsoft Dynamics® AX 2012
Advertisements

Advanced SQL (part 1) CS263 Lecture 7.
CC SQL Utilities.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification.
Copyright 2003Curt Hill Hash indexes Are they better or worse than a B+Tree?
Technical BI Project Lifecycle
COMP 3715 Spring 05. Working with data in a DBMS Any database system must allow user to  Define data Relations Attributes Constraints  Manipulate data.
Concepts of Database Management Seventh Edition
Concepts of Database Management Sixth Edition
Introduction to Structured Query Language (SQL)
Introduction to Structured Query Language (SQL)
Temple University – CIS Dept. CIS331– Principles of Database Systems V. Megalooikonomou Query by example (based on notes by Silberchatz,Korth, and Sudarshan.
Database Systems More SQL Database Design -- More SQL1.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 7 Introduction to Structured Query Language (SQL)
Microsoft Access 2010 Chapter 7 Using SQL.
DYNAMICS CRM AS AN xRM DEVELOPMENT PLATFORM Jim Novak Solution Architect Celedon Partners, LLC
SQL Server Reporting Services London Database Developer Forum Anoop Patel.
Rationale Aspiring Database Developers should be able to efficiently query and maintain databases. This module will help students learn the Structured.
ASP.NET Programming with C# and SQL Server First Edition
SQL 資料庫查詢語言 取材自 EIS, 3 rd edition By Dunn et al..
©Silberschatz, Korth and Sudarshan5.1Database System Concepts Chapter 5: Other Relational Languages Query-by-Example (QBE) Datalog.
Practical Session 13 Structured Data Bases Structured Query Language Exam Questions Factory Method Pattern Abstract Factory Pattern.
CSE314 Database Systems More SQL: Complex Queries, Triggers, Views, and Schema Modification Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Developing Reporting Solutions with SQL Server
HAP 709 – Healthcare Databases SQL Data Manipulation Language (DML) Updated Fall, 2009.
SQL (Chapter 2: Simple queries; Chapter 7 and 8: Nested and DML queries) Many of the examples in this document are based on the tables in the next slide.
Concepts of Database Management Seventh Edition
Structured Query Language Chris Nelson CS 157B Spring 2008.
Database Systems Microsoft Access Practical #3 Queries Nos 215.
©Silberschatz, Korth and Sudarshan5.1Database System Concepts Chapter 5: Other Relational Languages Query-by-Example (QBE)
Robin Mullinix Systems Analyst GeorgiaFIRST Financials PeopleSoft Query: The Next Step.
SQL queries ordering and grouping and joins
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Chapter 11 Functions and Groups Part C. SQL Copyright 2005 Radian Publishing Co.
Intro to SQL Management Studio. Please Be Sure!! Make sure that your access is read only. If it isn’t, you have the potential to change data within your.
Copyright © Curt Hill Queries in SQL More options.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Source: Database System Concepts, Silberschatz etc Edited: Wei-Pang Yang, IM.NDHU, Introduction to Database CHAPTER 5 Other Relational Languages.
Chapter 4: SQL Complex Queries Complex Queries Views Views Modification of the Database Modification of the Database Joined Relations Joined Relations.
IST 210 SQL Todd Bacastow IST 210: Organization of Data.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
Lecture 8 – SQL Joins – assemble new views from existing tables INNER JOIN’s The Cartesian Product Theta Joins and Equi-joins Self Joins Natural Join.
Structured Query Language SQL Unit 2 An Introduction to Organizing and Retrieving Data with SQL.
SqlExam1Review.ppt EXAM - 1. SQL stands for -- Structured Query Language Putting a manual database on a computer ensures? Data is more current Data is.
A Guide to SQL, Eighth Edition Chapter Four Single-Table Queries.
1 SQL II CIS*2450 Advanced Programming Concepts. 2 Data Types INTEGER –numbers without a decimal point –range is to SMALLINT –like.
Practical Session 13 Factory Method Pattern Abstract Factory Pattern Structured Data Bases Structured Query Language Exam Questions.
Thinking in Sets and SQL Query Logical Processing.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
Module 2: Authoring Basic Reports. Overview Creating a Basic Table Report Formatting Report Pages Calculating Values.
Aggregator Stage : Definition : Aggregator classifies data rows from a single input link into groups and calculates totals or other aggregate functions.
Lecture 9 Using Structured Query Language (SQL) Jeffery S. Horsburgh Hydroinformatics Fall 2012 This work was funded by National Science Foundation Grant.
Computer Science & Engineering 2111 Inner Joins and Advanced Queries 1CSE 2111 Lecture-Advanced Queries.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
SQL - Training Rajesh Charles. Agenda (Complete Course) Introduction Testing Methodologies Manual Testing Practical Workshop Automation Testing Practical.
More SQL: Complex Queries, Triggers, Views, and Schema Modification
More SQL: Complex Queries,
Relational Database Design
Chapter 3: Relational Model III
SQL FUNDAMENTALS CDSE Days 2018.
Using SQL to Prepare Data for Analysis
Chapter # 7 Introduction to Structured Query Language (SQL) Part II.
CS 3630 Database Design and Implementation
More SQL: Complex Queries, Triggers, Views, and Schema Modification
Database systems Lecture 3 – SQL + CRUD
Chapter 7 Introduction to Structured Query Language (SQL)
CS4222 Principles of Database System
Contents Preface I Introduction Lesson Objectives I-2
Query Functions.
Shelly Cashman: Microsoft Access 2016
Presentation transcript:

@CRMUG Technical Academy Fetch Xml Were can Fetch Xml be used Basic Fetch Xml and using advanced find to build your own Fetch Query Creating Fetch Xml that containing outer joins Creating Fetch Xml Queries that contain aggregates How to generate advanced CRM views using Fetch Xml Reference Materials

@CRMUG Were can Fetch Xml be used  Using the CRM SDK using OrganizationService.RetrieveMultiple request  SSRS reports authored with Report Authoring Extension  Creating advanced views you are unable to create using the GUI advanced find interface  JavaScript using the SOAP protocol and an OrganizationService.RetrieveMultiple request – Usually Developers will user the ODATA Rest Endpoint to retrieve multiple with JS because of its ease of use

@CRMUG C# Retrieve Multiple Example string FetchXml = ", ConfigurationManager.AppSettings["From Address"]); EntityCollection ec = service.RetrieveMultiple(new FetchExpression(FetchXml));

@CRMUG C# Fetch Xml Warnings  For larger data (larger than 5000) sets when using Fetch Xml within CRM you will have to paginate your retrieval of the records.  Example Example  The example provided just outputs the results onto a console screen, when I develop items I will with place them into a List or process 5000 records at a time depending on the requirements.

@CRMUG Report Authoring Extension  Small application that must be installed on a computer  CRM 2015 Report Authoring Extension CRM 2015 Report Authoring Extension – Visual Studio 2012 or 2010 with SQL Server Data Tools required.  CRM 2013 Report Authoring Extension CRM 2013 Report Authoring Extension – BIDS and Visual Studio 2008 SP 1 required or Visual Studio 2010 with SQL Server Data Tools  CRM 2011 Report Authoring Extension CRM 2011 Report Authoring Extension – BIDS and Visual Studio 2008 SP 1 required or Visual Studio 2010 with SQL Server Data Tools

@CRMUG Using Advanced Find to build Fetch Xml  Demonstration  –

@CRMUG Fetch Xml Basics

@CRMUG SQL Equivalent select contact.contactid, contact.fullname, contact. address1, contact.telephone1, account.industrycode, account.revenue, account.name from filteredcontact contact inner join filteredaccount account on account.accountid=contact.parentcustomerid where contact.address1_stateorprovince='OH' and and account.industrycode in (1,37,6) order by contact.fullname asc

@CRMUG Breaking Down the Basics  Header and Xml Definition   This line is static and should be used in each of your fetch statements.

@CRMUG Breaking Down the Basics  Primary Entity   Defines the entity that will be the frame of reference for the remainder of the report.  If you are using this for SSRS reporting and want to use the Pre Filtering functionality this can be done with XML formatted like:  SQL equivalent of from

@CRMUG Breaking Down the Basics  Attribute selection –  The attribute name must match the schema name from your Dynamics CRM environment.  SQL equivalent of select  Available attributes of the attribute tag – alias – aggregate – dategrouping(only for date fields) – groupby

@CRMUG Breaking Down the Basics  Filtering –  SQL Equivalent of where  Common operators – eq is the equal requires a value – eq-userid is current user no associated value – in is for Pick lists and Lookups ONLY and have tags for each value – next-x-days requires an integer value – null is the does not contain data this has no associated value – not-null is the contains data this has no associated value

@CRMUG Breaking Down the Basics  Sorting –  SQL equivalent of Order By  This line MUST be placed under an entity tag and can never be placed under a linked entity tag – This means you are still bound by the limitation that you can only sort by fields that exist with the primary entity just like views in CRM.  Descending attribute can be true or false

@CRMUG Breaking Down the Basics  Link Entity –  SQL equivalent of join  Can contain an additional attribute of link- type to define if this is an inner or outer join. – More on this later

@CRMUG Creating Fetch Xml that containing outer joins  The above query is a list of all leads that do not have a task regarding them.  Things to note is the filter is outside of the link-entity and uses an aliased entity name to look for the null reference.  Similar methodologies can be used to generate views with outer joins that you do not want to have an inner join.

@CRMUG SQL Equivalent select lead.fullname from filteredleads lead left outer join filteredtasks task on lead.LeadId=task.RegardingObjectId where task.RegardingObjectId is null

@CRMUG Creating Fetch Xml Queries that contain aggregates  Why user aggregates instead of retrieving the full data set and using grouping in SSRS – Fetch Xml data sets can be very large and if you are pulling the entire detail for larger data sets the execution time can be quite long for users.  There is a CRM parameter called AggregateQueryRecordLimit which is set to 50,000 records. This means that no single aggregate can contain more that 50,000 distinct recrods. For CRM on premise this can be altered using C# or PowerShell note: this change is at the server level and NOT at the organization level. CRM online this value cannot be changed.

@CRMUG Creating Fetch Xml Queries that contain aggregates  Notice the use of the group by to get groupings by year or to include which level you want your aggregates.  Notice how the order uses the alias instead of the attribute that we used previously

@CRMUG Creating Fetch Xml Queries that contain aggregates  Available aggregation types – sum – avg – min – max – count(*) – count(attribute name)

@CRMUG Creating Views in CRM with an Outer Join  Demonstration  –

@CRMUG Reference Materials  Fetch Xml schema Fetch Xml schema  Fetch Xml based Reports: Bits & Pieces Fetch Xml based Reports: Bits & Pieces  Microsoft Dynamics CRM 2011 – Develop Fetch Xml Based SSRS Reports in Visual Studio 2008 Microsoft Dynamics CRM 2011 – Develop Fetch Xml Based SSRS Reports in Visual Studio 2008  MSDN Building queries with Fetch Xml MSDN Building queries with Fetch Xml

@CRMUG