cub-e.net

just coding...

Overview of Dynamics 365 for Sales April '19 release

Customer engagement is about more than touchpoints. For sales organization to be successful, it requires creating meaningful connections, building relationships, and nurturing the relationships to establish trust. To build these relationships, sales professionals need robust and up-to-the-moment customer insights as well as the ability to collaborate effectively to deliver customer commitments.

Dynamics 365 for Sales and Microsoft Relationship enable sales reps to build deeper customer connections at scale using the power of Dynamics 365, LinkedIn, and Office 365. Sales professionals receive recommended content in addition to activities and notes through the sales playbook when working on an opportunity, helping to ensure they are using the right content for the right context.

The configure-price-quote capability enables sales professionals to efficiently put together the right product solution and quote the solution to customers. The ability to do simple forecasting will help in situations where external checks and adjustments need to be accounted for. 

dynamics 365 sales ile ilgili görsel sonucu


Overview of Dynamics 365 for Marketing April '19 release

Dynamics 365 for Marketing is a marketing automation solution that can help businesses turn more prospects into business relationships. Since its launch in April 2018, Dynamics 365 for Marketing has seen increasing adoption by organizations looking to nurture more sales-ready leads, align sales and marketing, make smarter decisions and grow with an adaptable platform. The app goes beyond basic email marketing to provide deep insights and generate qualified leads for your sales teams. Its graphical content-creation and design tools make visually rich emails, landing pages, and customer journeys easy to design and execute.

Our customers are increasingly looking to tailor the app to various roles and personas within their organization. They want to keep their user experience simple while achieving business goals through interconnected customer journeys. This requires support for centralized implementation by a few power users while enabling marketers to tweak their campaigns for the best returns. It also requires integrated actionable intelligence at every step to improve decision making and identify the best path forward.

The April '19 release lights up new intelligent scenarios and enhanced extensibility capabilities so customers and partners can tailor the application to specific needs. The application also adds social marketing capabilities beyond its existing social insights and analytics. Here are the key investment areas for the April '19 release:

  • Actionable intelligence lets you build optimized target segments, craft appealing content for better delivery, and orchestrate effective communications strategies. It leverages rich data sets available with the marketing app to help marketers maximize the impact of their campaigns.

  • Personalized marketing now extends to landing pages, which can provide content that's personalized for known visitors. Design innovative new marketing experiences that feature mixed reality to help drive richer engagement with potential leads. Marketers can achieve more on social channels by posting right from the app.

  • Easy Onboarding Trial sign-ups can now be done in a few steps and spun quickly in minutes. New users can get started through the intuitive dashboard and discover value with guided tasks for common marketing scenarios. This comes along with general usability improvements for better experience.

  • Integrate and extend the solution. Platform extensibility enhancements help customers and partners meet specific needs, deliver turnkey projects, and support vertical scenarios. New APIs will enable you to link journeys to business processes, and to create target segments programmatically. You can use your own content management system to submit information directly via forms, and to set up event pages or landing pages. Social integration is further enhanced to include social-posting capabilities. Sales users can now influence marketing with a few clicks.

  • Fundamental investments continue to deliver improved usability, performance, scalability and throughput for campaign execution and email marketing. The segmentation interface has been improved and optimized for frequently used marketing scenarios. Usability improvements in insights provide complete visibility across all campaign elements, form interactions, email messages, and more.


dynamics 365 marketing ile ilgili görsel sonucu

Overview of Dynamics 365 for Customer Service April '19 release

Dynamics 365 for Customer Service aims to enable businesses to differentiate themselves from their competition by providing world-class customer experiences. Customers today value the ease and speed of resolution and they want to receive service on their preferred channel of engagement, at any time, and on any device. We are enabling these capabilities by building an intelligent omni-channel customer experience and an empowered agent experience.

A true omni-channel experience in the product will preserve context and provide a continuous experience as customers seamlessly switch across self-service, peer-to-peer service, and assisted-service channels. An empowered agent experience will provide an application experience that is unified across channels and line of business (LOB) applications, is contextual to the engagement, and comes with productivity tools to resolve issues faster.

Themes for Customer Service April '19 release

  • Channels: In line with our goal to provide increased channel flexibility to customers, we will provide live chat as a channel for customers to seek real-time support. We will also enable SMS support for customers to receive automatic notifications and engage with support agents at their own pace.

  • Agent experience: In the October '18 release, we released the Omni-channel Engagement Hub for preview. Omni-channel Engagement Hub is a customizable, high-productivity app built on Unified Service Desk for agents working on multiple channels. In the April '19 release, we will make this generally available. In addition, we will offer a browser-based multi-session, multi-app agent experience built on the Unified Interface framework.

    Case management is a cornerstone capability in customer service. We will rework key experiences to improve usability and productivity.

  • Knowledge management: We will make key enhancements to the knowledge base (KB) authoring experience. KB admins can create KB templates for common scenarios like FAQs, how-to articles, and so on. KB authors can leverage these templates to quickly create standardized KB articles.

dynamics 365 customer service ile ilgili görsel sonucu

It is time for London event...

It is time for the biggest D365 Saturday event all the world! This event will take place at the Microsoft Office in Paddington London on 19 January 2019. Full details and event schedule is here: http://365saturday.com/dynamics/london-2019/

Dynamics 365 Saturday is a free Technical & Strategy Event Organised by the Microsoft Dynamics Community MVP’s For CRM and ERP professionals, technical consultants & developers. Learn & share new skills whilst promoting best practices, helping organisations overcome the challenges of implementing a successful digital transformation strategy with Microsoft Dynamics 365.

Dynamics 365 Saturday will replace CRM Saturday to provide a single platform to serve the whole Dynamics 365 community, the core customer experience values and ethics of CRM Saturday will continue to live on through 365 Saturday with the rest of the Dynamics Community.

I have a session in this event on 10th February. Session name is “Dynamics 365 V9 New Features & Deprecations” in Microsoft Dubai Office in Media City between 13:00 and 14:00. Also, I will share my knowledge on Dynamics 365 in Hackathon on 11th February.

My session focuses on who interested in taking the plunge to “code”. The session will be covering all development structure. Attendees can easily see the difference between versions from a development perspective and will be particularly helpful for those who work on upgrade projects.

Full details here: http://365saturday.com/dynamics/london-2019/

13

New D365 Saturday event at Brussels Belgium

As always we have full day speaking events in two rooms! Please join us if you around. 17 Nov 2018...

Dynamics 365 Saturday is a free Technical & Strategy Event Organised by the Microsoft Dynamics Community MVP’s For CRM and ERP professionals, technical consultants & developers. Learn & share new skills whilst promoting best practices, helping organisations overcome the challenges of implementing a successful digital transformation strategy with Microsoft Dynamics 365.

Dynamics 365 Saturday will replace CRM Saturday to provide a single platform to serve the whole Dynamics 365 community, the core customer experience values and ethics of CRM Saturday will continue to live on through 365 Saturday with the rest of the Dynamics Community.

I have a session in this event on 10th February. Session name is “Dynamics 365 V9 New Features & Deprecations” in Microsoft Dubai Office in Media City between 13:00 and 14:00. Also, I will share my knowledge on Dynamics 365 in Hackathon on 11th February.

My session focuses on who interested in taking the plunge to “code”. The session will be covering all development structure. Attendees can easily see the difference between versions from a development perspective and will be particularly helpful for those who work on upgrade projects.

full details here: http://365saturday.com/dynamics/belgium/

13

Directions EMEA 2018 - The Hague

Directions EMEA is an independent conference for Microsoft Dynamics partners from the ERP and CRM channels focusing on the SMB market. It is organized by partners for partners.

The Directions conference provides the Dynamics community with a forum for knowledge sharing, networking and discovering new opportunities for future growth and collaboration. It is a must-attend event where partners can enhance and build their networks to reach a broader SMB market, learn about the latest product developments and tools, as well as enrich their operational and technical knowledge.

Since 2008 Directions EMEA has grown year by year. 2018 will take place in The Hague on October 29 – 31, 2018.

I have a session in this event on 29th October Monday in S-America room.

See you there 🙂

Using ITracingService in Microsoft Dynamics CRM plugins

The ITracingService interface provides a way to log plug-in run-time information. This method of logging information is especially useful for sandboxed plug-ins registered with Microsoft Dynamics CRM Online that cannot otherwise be debugged using a debugger.  It was introduced in CRM 2011.

Tracing assists developers by recording run-time custom information as an aid in diagnosing the cause of code failures. Tracing is especially useful to troubleshoot Microsoft Dynamics CRM Online registered custom code as it is the only supported troubleshooting method for that scenario. Tracing is supported for sandboxed (partial trust) and full trust registered custom code and during synchronous or asynchronous execution. Tracing isn’t supported for custom code that executes in Microsoft Dynamics CRM for Outlook or another mobile client.

The tracing information is displayed in a dialog of the Microsoft Dynamics CRM Web application or in the event log for on-premise deployments, only if an exception is passed from a plug-in back to the platform.  However, starting with CRM Online 2015 Update 1, a trace logging feature was introduced that records tracing information even when an error does not occur.

Logging and tracing


An alternative method to troubleshoot a plug-in or custom workflow activity (custom code), compared to debugging in Microsoft Visual Studio, is to use tracing. Tracing assists developers by recording run-time custom information as an aid in diagnosing the cause of code failures. Tracing is especially useful to troubleshoot Microsoft Dynamics 365 (online) registered custom code as it is the only supported troubleshooting method for that scenario. Tracing is supported for sandboxed (partial trust) and full trust registered custom code and during synchronous or asynchronous execution. Tracing isn’t supported for custom code that executes in Microsoft Dynamics 365 for Outlook or another mobile client.

Recording of run-time tracing information for Microsoft Dynamics 365 is provided by a service named ITracingService. Information provided to this service by custom code can be recorded in three different places as identified here.

  • Trace log
    Trace log records of type PluginTraceLog can be found in the web application by navigating to Settings and choosing the Plug-in Trace Log tile. The tile is only visible if you have access to the trace log entity records in your assigned security role. Writing of these records is controlled by the trace settings mentioned in the next section. For information on required privileges for the PluginTraceLog entity, see Privileges by entity.
  • Error dialog
    Asynchronous registered plug-in or custom workflow activity that returns an exception back to the platform results in an error dialog box in the web application presented to the logged on user. The user may select the Download Log File button in the dialog to view the log containing exception and trace output.
  • System job
    For asynchronous registered plug-in or custom workflow activities that returns an exception, the tracing information is shown in the Details area of the System Job form in the web application.

Enable trace logging:


To enable trace logging in an organization that supports this feature, in the web application navigate to Settings > Administration> System Settings. In the Customization tab, locate the drop-down menu labeled Enable logging to plug-in trace log and select one of the available options. 

Option

Description

Off

Writing to the trace log is disabled. No PluginTraceLog records will be created. However, custom code can still call the Trace method even though no log is written.

Exceptions

Trace information is written to the log if an exception is passed back to the platform from custom code. 

All

Trace information is written to the log upon code completion or an exception is passed back to the platform from the custom code.


If the trace logging setting is set to Exception and your custom code returns an exception back to the platform, a trace log record is created and tracing information is also written to one other location. For custom code that executes synchronously, the information is presented to the user in an error dialog box, otherwise, for asynchronous code, the information is written to the related system job.

By default, the System Administrator and System Customizer roles have the required privileges to change the trace logging setting, which is stored in a TraceSettings entity record. Trace settings have an organization scope.


Writing to the trace service from a Plug-in:

Before writing to the tracing service, you must first extract the tracing service object from the passed execution context. Afterward, simply add Trace calls to your custom code where appropriate passing any relevant diagnostic information in that method call.

//Extract the tracing service for use in debugging sandboxed plug-ins.

ITracingService tracingService =

    (ITracingService)serviceProvider.GetService(typeof(ITracingService));

// Obtain the execution context from the service provider.

IPluginExecutionContext context = (IPluginExecutionContext)

    serviceProvider.GetService(typeof(IPluginExecutionContext));

// For this sample, execute the plug-in code only while the client is online.

tracingService.Trace("AdvancedPlugin: Verifying the client is not offline.");

if (context.IsExecutingOffline || context.IsOfflinePlayback)

    return;

// The InputParameters collection contains all the data passed

// in the message request.

if (context.InputParameters.Contains("Target") &&

    context.InputParameters["Target"is Entity)

{

    // Obtain the target entity from the Input Parameters.

    tracingService.Trace

        ("AdvancedPlugin: Getting the target entity from Input Parameters.");

    Entity entity = (Entity)context.InputParameters["Target"];

 

    // Obtain the image entity from the Pre Entity Images.

    tracingService.Trace

        ("AdvancedPlugin: Getting image entity from PreEntityImages.");

    Entity image = (Entity)context.PreEntityImages["Target"];

}


References:

·  ITracingService Interface - https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.itracingservice.aspx

·  Debug a plug-In - https://msdn.microsoft.com/en-us/library/gg328574.aspx

·  Sample: Web access from a sandboxed plug-in - https://msdn.microsoft.com/en-us/library/gg509030.aspx
·  Sample: Calculate Price plug-in - https://msdn.microsoft.com/en-us/library/dn817877.aspx

Managing Complex CRM Scenarios by Using the SolutionPackager Tool


In enterprise scenarios, it is a common requirement to be able to deliver common or separate CRM modules to separate business units according to an enterprise-level or separate roll-out timeline.

The typical challenges of this scenario result from parallel development tracks and frequent changes to enterprise projects, which require the greatest degree of flexibility in every aspect:

§ Sharing common code/customization base

§ Managing solution layering and dependencies

§ Managing localization

§ Managing changes in layering (moving items to common or back, customizing common elements locally)

§ Versioning common and local solutions

§ Parallel development on multiple solutions, multiple solution-layer setups, and multiple versions of a solution

§ Central repository of every/any solution

§ Test and deploy all possible or required combination of solution layers

§ Managing solution branch and merge

§ Regression testing changes and impacts across solutions and branches

§ Common, single versioning of all solution elements

Development and Version Control

You need streamlined and common techniques of development and repository management for complex enterprise deliveries. The standard features of Microsoft Team Foundation Server serve as the basis of larger application delivery management scenarios:


§ ALM

§ Debugging and diagnostics

§ Testing tools

§ Architecture and modeling

§ Database development

§ Integrated development environment

§ Build management and automation

§ Version control

§ Test case management

§ Work item tracking

§ Reports and dashboards

§ Lab management


When working with multiple development teams developing multiple solutions and versions in parallel on an enterprise delivery, the following base process is minimally recommended:


§ Developers should have isolated VMs to work on either hosted locally or centrally to share infrastructure between team members. Every developer work-item needs to be committed to the TFS environment (integration environment).

§ The development lead is in charge of making sure that the developments (customizations, configurations, and custom source files) can integrate in the integration environment without any side effects.

§ The TFS source control should be considered as the central repository for all solution items:

§ All CRM customizations (Entities, forms, views, workflows, templates, web resources, etc.)

§ Base data

§ Source codes and projects for custom components

o Plug-ins, custom activities

o Custom web applications

o Custom .Net components

o Custom services and other external components

o Web resource files


§ External components and references (SDK, Enterprise Library, etc.)

§ Unit test source codes for above components

§ Automated test sources for the entire application

§ Setup package for the entire application

§ Deployment scripts for the packages

§ Build definition for the entire application

The customer requirements and the work-item break-down should be stored in TFS work-item management. This way the development check-ins can be connected to the work-items, and the built-in development tracking and reporting functions of TFS can be leveraged. You will also be able to use the change-impact analysis functions of TFS for risk analysis and selecting the regression test scenarios for a specific change-set.

In multi-feature and multi-team scenarios you usually need multiple development and test environments, probably using different versions of the application. The TFS build automation and lab management functions provide the necessary toolset for managing daily build and deployment steps. You find more details about the topic in the Build and Test sections.

Version Control Process

The CRM customizations are out-of-the-box bound to a single CRM solution zip file, which requires special techniques to manage as part of a source control system.

The SolutionPackager tool (see Use the SolutionPackager Tool to Compress and Extract a Solution File) is designed to unpack (split) a solution .zip file into a broad set of files within folders by entity name. The breakout into files enables that modifications to different components will not cause changes to occur in the same files. For example, modifying an entity Form and a View would result in changes in different files (hence no conflicts to resolve). Pack will take the files from disk and glue them back together to construct a managed or unmanaged .zip file.

The development process for Solution Packages with the SolutionPackager tool is illustrated in the following graphic.



 


The developer works on his/her daily environment to work on the CRM development task allocated. Before starting a work item the developer (or the build master) gets the latest version of customization tree from TFS and uses the SolutionPackager tool to create the solution zip file. The developer (or the build master) deploys the latest solution package on the development environment. The same solution can also be deployed to the test CRM environment.


At the end of a day or after finishing a work item, the developer exports the solution zip file from the development environment. Executing the SolutionPackager tool on the zip file will generate the separate customization elements of the entire solution. The customization files need to be checked out and checked-in individually only when changed.

The Visual Studio project may be created manually. The SolutionPackager tool will automatically create the folder structure below that (the unpack script need to be executed in the solution project folder).

Manual Steps

The current version of SolutionPackager tool provides the basic functionality to convert the packaged customization zip file to a version controllable folder structure. The following manual steps are still needed by the developers or test leads to be able to maintain the source tree:

1.   Check-in check-out of specific customization elements, which will be affected by a work-item change.

2.   Execute the pack/unpack operation manually and selecting the changed customization elements (Note: this can be integrated into the clean and deploy process of the Developer Toolkit).

3.   Taking care of the managed and unmanaged version of components at check-in time.

4.   Managing the assembly versioning (FQ strong names) of plug-ins used by a CRM solution.

5.   Managing RibbonDiffXML (merging changes).

The following techniques may be used to further support the version control process:

§ Removing assembly strong names from customization files to be able to track only the real changes.

§ Some schema parts are reordered randomly during solution import-export; these elements may be ordered alphabetically to more convenient source control tracking.

Localization Challenges

Enterprise CRM projects usually face the requirement of supporting multiple locales. Although CRM has OOB support for localization, it is always a challenge to provide full solution localization because different components required different localization strategies, and the explosion of components may be required.

Localization of some specific CRM components is currently not supported or not applicable. For example:


§ Workflows

§ Dialogs

§ Templates


CRM Developer Toolkit

§ Roles & FLS profiles

§ Plug-in assemblies


The CRM Developer Toolkit may be used for daily developer work for creating streamlined plug-ins, generating codes, solutions, and accessing CRM customization pages. The source code should be checked in directly under TFS. The applied customizations can be exported, unpacked from the CRM organization, and the specific changed elements can be checked in manually.

Note: The Developer Toolkit can support the process of packing and unpacking by turning on the ability to export a CRM Solution as part of the local deployment process.

Sitemap, Ribbon Editor

The CRM customization system only supports editing the sitemap and ribbon definition manually as xml files, after a manual export and followed by an import operation. The SiteMap and Ribbon Editor tools provide a graphical UI for executing these types of customizations.

These tools can be also combined with the unpacked structure:

§ Sitemap.xml is unpacked into a separate xml file and can be directly edited by SiteMap Editor.

§ The Ribbon Editor supports editing directly on a CRM environment, so developers need to edit on the server and then unpack the solution zip file and check-in the changes.

Daily Developer Work

The developers should use unmanaged solutions and shared configuration environments during development time. One developer usually works on one solution (either CRM or other Visual Studio solution), but multiple developers can work on the same solution in parallel.

 

The developer environments should be typically updated on a per-day basis using the last successful build. You should consider the best environment allocation and setup strategy for your team, depending on the actual project and team setup (see Deployment and Test).

The developers typically use standard CRM customization UI for executing their daily work. They create CRM customization elements (entities, screens, ribbons, views, dialogs, plug-in registrations, etc.). They may use Visual Studio for creating custom developed plug-ins, web applications, or other components, and may also use other external tools such as resource editors, designers, sitemap, ribbon, and metadata editor for CRM.

The editing of external components and resources can be typically executed offline on the developer machine after executing the TFS check-out operation (VS built-in editors usually manages check-out automatically).

Just before the check-in, they need to export the solution from the CRM environment and execute a special batch file per solution, which will unpack the customization file.

Developers need to take care of the actual check-in. They need to be aware of the executed changes and which schema members it affected. Only the changed elements need to be checked-in, and there are also special cases when the check-in elements need also to be merged back or compared to the previous version (for example, ribbonDiffXml).

Before the actual check-in operation, the developer must get the latest sources and create a local build, including a solution package, to deploy and test in the development environment; this is the recommended practice for quality check-ins. This process may be also supported by the Gated Check-in or Continuous Integration feature of TFS.

The daily development process is illustrated in the following figure.



 

Build Automation

The build process can be automated using the standard TFS build agent. The build agent is a Windows service that executes the processor-intensive and disk-intensive work associated with tasks such as getting files from and checking files into the version control system, provisioning the workspace for the builds, compiling the source code, and running tests.

 


A typical build process consists of the following steps:

1.   Getting the build definition (You may have multiple parallel projects/builds.)

2.   Update build number (solution versioning)

3.   Prepare build context

a.   Create drop location

b.   Get build agent

c.Get build directory and initialize workspace

4.   Get source files

5.   Compile sources and create setup packages

6.   Run unit tests

7.   Process test results

8.   Drop build and notify

The build process may be extended further by automated deployment and testing (for more details see the Build, Test and Deployment sections):

§ Rollback test environments

§ Deploying setup packages to test environments

§ Executing automated test steps/schedule manual test scenarios






Offline Build Process

The offline build process is designed as an independent build flow enabled to execute the building of a whole CRM solution package without a running instance of Dynamics CRM. The offline build process leverages the static schema of the solution elements and customization files (see Development and Version Control).

 




The build process can be easily extended to use the SolutionPackager tool. The CRM Solution Builder project template and target file samples can be used to integrate the pack operation into the daily build process (see CRM Solution Builder).

During the build process, the Visual Studio standard projects will be compiled, built, and dropped as defined in the build and project definitions.

Building the CRM customization project will trigger the pack operation will the up-to-date customization source tree (see solution tree structure above). All customizations will be merged together as a single customization.xml and solution.xml file. The previously built solution resources and assemblies can be included directly in the solution package.

Note: ILMerge operation may be required to make DB-registered assemblies work with referenced assemblies.

Automating Deployment

The deployment automation of packed CRM solution can be executed identically to standard CRM solution deployment.

On enterprise projects the following scenarios can cover the typical deployment requirements:

§ Automated deployment of development environments, test environments, and integration environments

§ Offline setup packages and scripts to enable deployment to acceptance and production environment as a sandbox

§ Rollback environments to a baseline (both CRM components and the CRM database)

o May already contain existing solutions and possible CRM Update Rollups

§ Deploying CRM solutions

§ Deploying CRM base data and custom security roles

§ Additional configuration of the organization, BU, and user settings using the CRM API

Note: For further details on CRM automated deployment process see the Test and Deployment sections.

Managed/Unmanaged Solutions

The version control differences between managed and unmanaged solutions are already described in Managing Version Requirements section. The SolutionPackager tool will process and unpack both types of solutions. The unpack process will create the differencing elements with “managed” postfix for easier version control management.


The general recommendations for using managed or unmanaged solutions:

§ Use unmanaged solutions for development.

§ Use managed solutions for all downstream environments.

§ Use as few solutions as possible for easier management.

§ Customize existing managed solutions as little as possible.

§ Execute integration tests using managed solutions frequently to test and address possible collisions.

§ Test managed solution combinations for every possible or supported scenario.

Avoid selecting all columns via Microsoft Dynamics CRM query APIs

For optimal performance, you should only select the minimum amount of data needed by your application when querying CRM data.  Queries that include a defined ColumnSet where the ColumnSet.AllColumns property is 'true' instruct the CRM data access platform to issue a SELECT * on all physical data included in the query plan.  This scenario should be avoided whenever possible.  
 

Violation Examples

ColumnSet.AllColumns setter method call

    var columns = new ColumnSet();

    columns.AllColumns = true;

 

    var query = new QueryExpression("account");

    query.ColumnSet = columns;

 

    var results = service.RetrieveMultiple(query);

ColumnSet(bool allColumns) constructor overload

    var query = new QueryExpression("account")

    {

        ColumnSet = new ColumnSet(true)

    };

 

    var results = service.RetrieveMultiple(query);

ColumnSet(bool allColumns) constructor overload for RetrieveRequest

    var entity = service.Retrieve("account"Guid.NewGuid(), new ColumnSet(true));


Guideline Examples 

 

ColumnSet(param string[] columns) constructor overload for QueryExpression

    var query = new QueryExpression("account")

    {

        ColumnSet = new ColumnSet("name""address1_city")

    };

 

    var results = service.RetrieveMultiple(query);

ColumnSet(param string[] columns) constructor overload for RetrieveRequest

    var entity = service.Retrieve("account"Guid.NewGuid(), new ColumnSet("name""address1_city"));

ColumnSet.AddColumn(string column) method call

    var query = new QueryExpression("account");

    query.ColumnSet.AddColumn("name");

    query.ColumnSet.AddColumn("address1_city");

 

    var results = service.RetrieveMultiple(query);

ColumnSet.AddColumns(param string[] columns) method call

    var query = new QueryExpression("account");

    query.ColumnSet.AddColumns("name""address1_city");

 

    var results = service.RetrieveMultiple(query);


Usage of the Retrieve method should set the columnSet parameter to a ColumnSet instance with specified columns.  Usage of QueryExpression should set the  QueryBase.ColumnSet property with the required attributes. 

The following messages contain reference a ColumnSet instance:

Message

ConvertQuoteToSalesOrderRequest Class 

ConvertSalesOrderToInvoiceRequest Class 

GenerateInvoiceFromOpportunityRequest Class 

GenerateQuoteFromOpportunityRequest Class 

GenerateSalesOrderFromOpportunityRequest Class 

QueryByAttribute Class 

QueryExpression Class 

RetrieveAllChildUsersSystemUserRequest Class 

RetrieveBusinessHierarchyBusinessUnitRequest Class 

RetrieveMembersTeamRequest Class 

RetrieveRequest Class 

RetrieveSubsidiaryTeamsBusinessUnitRequest Class 

RetrieveSubsidiaryUsersBusinessUnitRequest Class 

RetrieveTeamsSystemUserRequest Class 

RetrieveUnpublishedRequest Class 

RetrieveUserSettingsSystemUserRequest Class 

ReviseQuoteRequest Class 

SearchByBodyKbArticleRequest Class

 

Build queries with QueryExpression

In Microsoft Dynamics 365 (online & on-premises), you can use the QueryExpression class to programmatically build a query containing data filters and search conditions that define the scope of a database search. A query expression is used for single-object searches. For example, you can create a search to return all accounts that match certain search criteria. The QueryBase class is the base class for query expressions. There are two derived classes: QueryExpression and QueryByAttribute. The QueryExpression class supports complex queries. The QueryByAttribute class is a simple means to search for entities where attributes match specified values.

Query expressions are used in methods that retrieve more than one record, such as the IOrganizationService.RetrieveMultiple method, in messages that perform an operation on a result set specified by a query expression, such as BulkDeleteRequest and when the ID for a specific record is not known.

In addition, there is a new attribute on the organization entity, Organization.QuickFindRecordLimitEnabled. When this Boolean attribute is true, a limit is imposed on quick find queries. If a user provides search criteria in quick find that is not selective enough, the system detects this and stops the search. This supports a faster form of quick find and can make a big performance difference.


References:  

Use the QueryExpression Class

http://msdn.microsoft.com/en-us/library/gg334688.aspx

ColumnSet Class

http://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.query.columnset.aspx

Use of the ColumnSet Class

http://msdn.microsoft.com/en-us/library/gg309532.aspx