Posted in Certifications

MB2-877 Microsoft Dynamics 365 for Field Service Module 1 Topic – Configure product and service pricing

This is the 3rd blog of this series, before this I have created a blog on the first topic “Perform initial configuration steps”  from Module 1 which you can check here : MB2-877 Microsoft Dynamics 365 for Field Service Module 1 Topic – Perform initial configuration steps

In this blog we will cover up the second Topic from the module 1 “Configure product and service pricing

NOTE : Before we start the module I would strongly suggest you to understand product catalogue in dynamics crm as we will be using price lists, products, unit groups etc alot :   https://docs.microsoft.com/en-us/dynamics365/customer-engagement/sales-enterprise/set-up-product-catalog-walkthrough   and if you have the knowledge already lets begin:

 

  1. Configure product and service pricing features including minimum charge amount, minimum charge duration, and the flat fee option
    You can add default “Standard” Price List to your Product in field service, however when you think about “Service” you might want to handle its price list slightly different. In Field service to accomplish this “Field Service Price List” has been added to dynamics CRM:
    Once you have configured a price list , you then navigate to “Related” option and click on “Field Service Price List Items”.

    ( Note that My field service is in Unified Interface so don’t get confused, I am intentionally using field service application – Once you have created a dynamics CRM trial for yourself which should include field service module too, you will see the field service app which you can access :

    So, Once your default price list – navigate to the related Field service price list and click on “Add new field service price list”

    If you see above I have set Flat Fee, Min Charge Amount & Minimum Charge Duration. Let’s understand what these options are:

    Flat Fee – If enabled then the pricing of this item will be not be multiplied by the quantity  and also Let’s you decide if a fixed fee for this service applies.

    Minimum Charge Duration–  If this field has a value , The Min charge will first apply to the minimum duration and beyond the min duration the standard charges will apply in short it will make some amount of time service free.

    Minimum Charge Amount –  As name suggest these are minimum charges for this service which correlates to the min charge duration. 

    lets do some math, assume my training per hour charge is 20,000 INR.
    now if  I apply above field service price list. The requirement is for 5 hours of training. then the math goes like this:

    Minimum Charge Duration defined by me is 1 hour. The requirement is 5 hour which means the bill will be for 4 hour which is 4*20,000= 80,000 INR then on this my minimum charge amount will be added which is 10,000 INR. So the final bill will be 90,000 INR.

     

  2. Add Products & Services to Incidents

    To this, simply navigate to Field service > Incident Type and add incident type. Once you do that; Now When you creating a work order and select incident there – it creates an incident for you which will have the product or service associated. so on a work order you can add product or services via incident.

  3. Determine when a Product has default Price List and a work order price list.

    Here are some quick points to cover up this topic. As we know Price List can be associated to following entities:

    • Account
    • Work Order
    • Agreement
    • product or service

    There there can be a clash in which price list to be used when they combine such as what if work order has a price list & also associated product has a price list too, in that scenario we’ll consider below:

    a. The Work Order Price List is used if a product has a different default price list than the Work Order

    b. The price of the product will come from the list price on the product if an Item is not on the Work Order Price List


  4. Associate Products & Services to Price Lists.

    Its Quiet easy and straight forward to associated a product or service to a price list. To do this go from Field service navigation > Field service navigation then click on an existing price list or create new as needed.



    Open an existing price list or create new one and click on “Price List Items” & click on “+Add New Price List Item”:



    Add the Product to it in my case I have added as “Exam preparation” and its Unit in “Hour” which is all defined on the product level and click on Save and Close.



  5. Define tax code.
    You can define tax code within your dynamics CRM field service. Remember you can have different scenarios/requirement to have different – different tax codes.

    To define a tax code, click on the dynamics 365 navigation from within field service app and click on field service setting and then on “Tax Codes“:

    Click on “Add new tax code”:

    Few important points on Tax Codes:  
    a. Used to define how tax on Work Order charged
    b. Tax options for products,
    agreements, and services
    c. Can be individually defined
    for each taxable item
    d. A tax code can contain
    multiple child tax codes and hence the total tax is defined by the sum of all the children.

 

Posted in Certifications

MB2-877 Microsoft Dynamics 365 for Field Service Exam Overview

I have been planning for this certification since quiet a while now. I am very much attracted towards the field service addition to dynamics CRM hence I decided to finally schedule the exam.

So will be preparing for this exam for next couple of weeks & as I go, I will be creating blogs on my study for this exam. I will try to put as much as details and explanation to understand the concepts.

The blog series will be fully aligned with the exam pattern given on the Microsoft learning page:

1.png

Visit this page here :  https://www.microsoft.com/en-us/learning/exam-mb2-877.aspx & familiarize yourself with this exam.

What will you get out of this exam?

Well, I should have wrote this question in the beginning of this blog but it is not too late to talk about this now!
If you have a client which very much customer oriented and does a lot field work such as proving services as at home such as Instillation, uninstallation, fix/repair/service of the products that company offers,  The field service module of dynamics CRM is perfect for them. Hence you have to have knowledge on this module of dynamics CRM.

I am very much excited to start the series and hope so are you.
In the next and very first blog, We will go through the the first main topic “Perform Initial Configuration Steps”  from Set up and Configure Field service module.

2.png

So, I will see you in the next blog shortly! Make sure you subscribe to my blogs to get notified on next blogs!

Posted in Deployment

Plugin Image Not Transferred with plugin Step In Deployment

Quick Blog:

I have recently encountered this issue where in a plugin image was not transferred along with the plugin step in the deployment.

Cause:

The plugin step was profiled in the source environment and the solution containing it was exported and deployed to other org.

I have a feeling if your plugin is profiled, the image will not be taken to other environment. Obviously it was a miss from the developer but this is something new i saw.

Solution:

All i did was unregistered the assembly from target environment —> unprofiled the step in source system — >exported the solution again from source — ->deployed the solution to target.

 

Hope this helps!

 

Posted in CRM Code Helpers

Get Most Recent Created On Record from Retrieved Entity Collection In Plugin

Sometimes, you may have a requirement to get the most recently created on record from the entity collection you have retrieved.

Instead of playing around a lot with coding and .net stuff, Dynamics CRM fetch XML and QueryExpression provides a way to sort records Ascending or descending.

Therefore, While retrieving records in FetchXML, do this :

<entity name='entityname'>
 <attribute name='atrributename1' /> 
   <attribute name='atrributename2' />    
    <attribute name ='attributename3' />                       
      <order attribute='createdon' descending='true' /> 
     <filter type='and'>                                  
     <condition attribute='statecode' operator='eq' value='0' />
   </filter>
</entity>

Or in Query Expression:

QueryExpression qe = new QueryExpression(entityName);
FilterExpression fe = new FilterExpression();
qe.ColumnSet = new ColumnSet(true);
qe.Orders.Add(new OrderExpression(columnname, ordertype)); 
service.RetrieveMulti ple(qe);

 

when Execute them , you will get the desired record on the top which can be access by simply by doing retrievedResult[0] or :

firstRecord= retrievedResult.Entities.First(); //first method.

firstrecord

I hope this helps!

cheers!

 

Posted in Audit History, CRM Code Helpers

Retrieve Audit History Changes For A Particular Field/Attribute Of A Record

Description:

Sometimes we have a requirement to retrieve audit history changes for a particular field in CRM which may be for the purpose of checking if for e.g field A value which is at the moment set to “10”, was ever “5” or may be “3” or may be use old those values of fields to create a new CRM Record. In the below Image , you can easily retrieve old and new values at any given time on birthday field by looping on each audit record:

audit1

I have taken the reference from Dynamics CRM SDK & MSDN to figure out how this can be achieved.

Please note : To be able to use this you must have Auditing enabled on all three areas of CRM.

1. Auditing for whole Organization should be already turned on.

2. Auditing for Entity Should be already turned on.

3. Auditing for that Field should already be turned on.

Solution Code:

I have accomplished this on a console application , you can do it in plugins or custom workflows as per the requirement.

Required :

Namespace:   Microsoft.Crm.Sdk.Messages

Assembly:  Microsoft.Crm.Sdk.Proxy (in Microsoft.Crm.Sdk.Proxy.dll)

try
   {
//initiate a new retrieve request & add entity logical name + Guid of the record to retrieve
    RetrieveRecordChangeHistoryRequest changeRequest = new RetrieveRecordChangeHistoryRequest();
    changeRequest.Target = new EntityReference("contact", Id);                RetrieveRecordChangeHistoryResponse changeResponse =

//Execute the request, the "details" variable will have the audit data. 
    (RetrieveRecordChangeHistoryResponse)_service.Execute(changeRequest);
    AuditDetailCollection details = changeResponse.AuditDetailCollection;

// Retrieve Particular attribute change history by passing entity logical
//name and guid of the record, finally execute using RetrieveRecordChangeHistoryResponse
    var attributeChangeHistoryRequest = new RetrieveAttributeChangeHistoryRequest
      {
           Target = new EntityReference("contact", Id),
           AttributeLogicalName = "birthday"

       };

     var attributeChangeHistoryResponse = (RetrieveAttributeChangeHistoryResponse)_service.Execute(attributeChangeHistoryRequest);
     details = attributeChangeHistoryResponse.AuditDetailCollection;

//Details will have many records for example birthday change records, loop through all of them
       foreach (var detail in details.AuditDetails)
         {
             var detailType = detail.GetType();
             if (detailType == typeof(AttributeAuditDetail))
                  {
// retrieve old & new value of each action of each audit change from AttributeAuditDetail
                var attributeDetail = (AttributeAuditDetail)detail;
                foreach (KeyValuePair<string, object> attribute in attributeDetail.NewValue.Attributes)

                        {

                        string oldValue = "(no value)", newValue = "(no value)";
                        if (attributeDetail.OldValue.Contains(attribute.Key))

                       oldValue = attributeDetail.OldValue[attribute.Key].ToString();
                       newValue = attributeDetail.NewValue[attribute.Key].ToString();

                       if (oldValue !=null & newValue!=null)
                            {
                             // Do Something here!
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
}

I hope this helps!

Posted in Reblogged

How to use Configuration Migration / Data Migration Utility in Dynamics CRM

Explore Dynamics CRM

In this blog i will detail on using Configuration Migration/ Data Migration utility. This can be used to move the configuration data from one CRM environment to other. generally Configuration data is used to defines custom functionality in CRM, which is typically stored in custom entities.

Often we need to migrate configuration data from one CRM environment to other, especially test data, master data setup etc. Microsoft provided an excellent tool for doing this.

Following are the benefits of using this tool,

  1. allows you to select entity and fields from where you want to export the configuration data.
  2. large amount of data from multiple entities can be moved from one crm environment to other.
  3. Data can be imported using the same GUID’s as that of the source system, hence lookup references to imported records will be valid.
  4. Schema file can be reused to export data from different source environments.

Below…

View original post 718 more words

Posted in Microsoft Dynamics CRM Solutions, Uncategorized

Solution Import Error 0x80044150 – Object reference not set to an instance of an object.

Issue:

While importing a solution I got a generic SQL error but when i downloaded the log file i saw below error:

import error1

0x80044150 – Object reference not set to an instance of an object 

I have seen this error in plugins several times but never in import but root cause and underlying issue remains the same.

The import was trying to find something which was not there in target.

Solution

There was a relationship in my solution exist as N:1 to an entity which was deleted from target system way back hence this error occurred. Using the relationship given in solution, CRM was trying to find related entity which wasn’t there.

 

Hope this helps.

Posted in Microsoft Dynamics CRM Services

When To Use Which Microsoft Dynamics CRM Web Service

thiking kid

Meet Jerry, he is wondering about dynamics crm services, In this blog I am helping him to understand when he should use which dynamics CRM web service.

Let’s first understand how many services dynamics crm offers post which will discuss which service to be used when:

  1. Web API
  2. Organization Service
  3. Organization Data Service
  4. Discovery Service
  5. Deployment Service

Web API

WebAPI is fairly new for dynamics CRM and i see many developers havent touched upon it. You should be using WebAPI Service while doing Client side development(preferably) such as Javascript, HTML etc. At this point its not easy to use WebAPI on server side but i am sure it will be possible in coming updates. Web API uses ODATA (Open data protocol). It also doesnt need any dynamics CRM related libraries or assemblies. You perform CRUD operation using XmlHttpRequests.  

Organization service

Organization service is basically a SOAP endpoint of dynamics crm and have been available since dynamics crm version 2011.  This Service has to be used with .Net Framework and for Business logic that runs in plug-ins or workflow assemblies on the server expect to use the Organization service.( So nothing client side). To work with Organization you have to use microsoft dynamics crm SDK i,e provided libabries and assemblies to interact with dynamics crm.

Organization Data service

It is also known as Odata service for dynamics crm which is Infact nothing but a “REST” Endpoint. You can utilise Odata endpoint in C# code( a server side code as well) but it is widely used for for client side scripting using javascript. However this has been deprecated with the release of dynamics crm 365 which means it is no longer supported. and completely replace with WebAPI.

 

Discovery web services

As the name suggest, this service should be used when you have mutiple CRM instances of dynamics crm in single deployment. You would use this service in your plugins ( the server side code) to get the current instance obtain the context.

 

Deployment web service

This service is barely used by developer as UI options are available. Such as Deployment manager etc. Use this service if you have create , delete or edit a dynamics crm organization/instance. Again its all server side.

 

I hope this clears your doubt as to when you would use which service and with what programming language.

Cheers!