Tuesday 8 December 2015

How to check whether the OpportunityProduct/QuoteProduct/OrderProduct is a bundle, product or bundled product in CRM

Hi,

Today I got a requirement to check the type of the product that is going to add to the opportunity and do some operation based on it.

This can be easily done by referring Product Type field of Opportunity Product /Quote Product/ Order Product. It is an Option Set with the below options.

ItemValue
Product1
Bundle2
Required Bundle Product3
Option Bundle Product4

Required and Optional refers to the Required field on Bundle Product.

Hope this helps.

--
Happy CRM'ing
Gopinath

Monday 7 December 2015

Stages, Stages Number and their use in CRM Plugins

Hi,

Sometimes we might get the chance to use only one Plugin on different and it would have separate business logic to perform on different stages.

Here is the table which shows the associated stage number with the stage name and the event.
EventStage NameStage NumberDescription
Pre-Event
Pre-validation10Stage in the pipeline for plug-ins that are to execute before the main system operation. Plug-ins registered in this stage may execute outside the database transaction.
Pre-EventPre-operation20Stage in the pipeline for plug-ins that are to execute before the main system operation. Plug-ins registered in this stage are executed within the database transaction.
Post-EventPost-operation40Stage in the pipeline for plug-ins which are to execute after the main operation. Plug-ins registered in this stage are executed within the database transaction.

We can use this numbers as conditions in the plugin as shown below.

You might be thinking why 30 is missing in the middle. We do have 30 but it is for main operation which we cannot use in the custom plugins.

Platform Core OperationMain Operation30In-transaction main operation of the system, such as create, update, delete, and so on. No custom plug-ins can be registered in this stage. For internal use only.

Hope this helps.

--
Happy CRM'ing

Gopinath

Build, Rebuild and Clean in Visual Studio

Hi,

Today I was talking to a fresher and explaining some of the shortcuts in Visual studio and how we build solutions etc.. and so thought of the writing about Build, Rebuild and Clean Solution in Visual Studio.

These three things very often used in Visual Studio.

Build Solution
Incremental build and compiles only the files that are modified. When build solution if there are no changes made to the files Visual Studio won't do anything. Visual Studio builds the assembly only if there are changes to the files.


Clean Solution
Deletes all compiled files, output directories. If your solution has multiple projects, VS cleans project by project.


Rebuild SolutionDeletes all compiled files and compiles all the things irrespective changes happened. In simple words, Clean + Build = Rebuild.

Hope this helps.

--
Happy Coding
Gopinath

Add Product, Add Family and Add Bundle button are missing in CRM

Hi,

Today I have activated French language on my CRM and checking some of things. I have a requirement to create a product and navigated to Product Catalog. Unfortunately, I was not able to see Add Product, Add Family and Add Bundle buttons.

English

 French

I thought, it was CRM issue but after some search came to know Products can be added only from the Core language like our Customizations.

Hope this helps.

--
Happy CRM'ing

Gopinath

Thursday 3 December 2015

Retrieve Access Team Members using FetchXML in CRM 2013/2015

Hi,

Today we got a requirement to fetch the users who are added on the Access Team of the record and do some operation.

Here is the Fetch XML to retrieve the users that were added to access team.

I was using for Order entity. If you are using for any other entity, you need to change the entity name in the 2nd line and ID schema name in the 4th line of the Fetch Xand pass record Id in the filter condition.

public static void GetAccessTeamMembers(IOrganizationService iService)
{
      string strFetchXML = @"<fetch>
                             <entity name='salesorder' >
                               <attribute name='name' />
                                   <link-entity name='principalobjectaccess' from='objectid' to='salesorderid' link-type='inner' alias='poa' >
                                      <attribute name='objectid' alias='objectid' />
                                      <link-entity name='team' from='teamid' to='principalid' link-type='inner' >
                                        <link-entity name='teamtemplate' from='teamtemplateid' to='teamtemplateid' >
                                          <attribute name='teamtemplatename' />
                                        </link-entity>
                                        <link-entity name='teammembership' from='teamid' to='teamid' link-type='inner' intersect='true' >
                                          <link-entity name='systemuser' from='systemuserid' to='systemuserid' link-type='inner' >
                                            <attribute name='fullname' />
                                         </link-entity>
                                       </link-entity>
                                      </link-entity>
                                      <filter type='and'>
                                       <condition attribute='objectid' operator='eq' value='GUID_OF_THE_RECORD' />
                                        </filter>  
                                    </link-entity>
                                  </entity>
                                </fetch>";

      EntityCollection entColAccessTeamMembers = iService.RetrieveMultiple(new FetchExpression(strFetchXML));
}

Hope this helps.

--
Happy CRM'ing

Gopinath

Tuesday 1 December 2015

Arabic Language Pack For Microsoft Dynamics CRM 2015

Hi,

I am working on Saudi Country CRM project. As their language is Arabic, they wanted to see CRM in Arabic language.

I thought, it would be damn easy to get the language pack and install it. But unfortunately, I could not find the Arabic language pack.


Don't waste your time like me, here is the direct link to get Arabic Language Pack.

https://www.microsoft.com/ar-sa/download/details.aspx?id=45014

Hope this helps.

--
Happy CRM'ing

Gopinath