Monday, 27 August 2018

CRM Concepts

CRM versions and release dates
CRM 2011-February 2011
crm2013-November 2013
crm2015-Jan 6, 2015
CRM 2016 Nov 2015
Dynamics 365 nov 2016


Differences between plugins and workflows

These are very similar, in fact workflows are just a skin on an asynchronous system plug-in. The main differences:

Workflows can only be triggered asynchronously
plugin can triggered both asynchronously and synchronously
Workflows can only be triggered online
Plugin can work offline too
Workflows have limited triggers. Mostly these would be your basic create/update/delete/assign/state change.
In addition to workflow plugin have extra Meeages retrieve,retrieve multiple,Grant access,revoke acces etc.
Plugins support different event execution pipelines. Workflows are always post operation.
Workflow execution logic can be easily modified, this allows encapsulation of code in custom workflow activity while still retaining possibility of frequent changes on execution logic by non-programmers.

----------------------------------------------------------------------
Secondary Entity:

"Secondary Entity use when you have to trigger plugin or retrieve record from Intersect Entity(contactleads) having records of Entities(Contact and Lead) having N:N Relationship".
------------------------------------------------------------------------
Plugin Stages
Pre-event/pre-validation
pre-event/pre-operation
post-event/post-operation


Pre-event/pre-validation

In this stage the plugin will execute before the main system operation.Plug-ins registered in this stage may execute outside the database transaction.
prevalidation stage occur prior to security check being peroformed on calling user or logged on user has the correct permission to perform the operation

Example:Delete plugins
Deletion happen prior to pre-operation,so if you need any prior information about child records,the delete plugin must be pre-validated.

pre-event/pre-operation
stage in the pipeline that are execute before the main system operation. plugins are execute within the database transaction

Example
Update Plugins on same records

post-event/post-operation
stage in the pipeline thatvare execute after the main system operation.pugins are execute with in the database transaction.

Example:On create of record we will this step.
--------------------------------------------------------------------------
Security Roles

these are a matrix of privilages and access levels for the various entites.
they are grouped under different tabs based on their functionality
Core records|marketing|Sales|Service| Business Mangaement| Service Mangement|Customization|Custom Entities

>Privilages
create
To Create the Record
Read
To View the record
Write
To edit the record
Delete
To delete the record
Assign
To change the ownership or assign the record to the other user with specified privilages
Share
To Share the record with other users with specifified privilages
Append to
To associate other entities to the record
Append
To Associate other entity record to parent record

Let us say that you want to attach a note to a case then note entity should have 'Append' access right and case entity should have 'Append To' access right. Let us take one more example to understand this. Suppose you have two custom entities called 'TestCustomEntity1' and 'TestCustomEntity2'. You want to attach the 'TestCustomeEntity2' records to 'TestCustomEntity1'records. For this you need to have 'Append' access right on 'TestCustomEntity1' entity and 'Append To' access right on 'TestCustomEntity2'.Now guess will I be able to attach the records? Answer is “NO" because we need to create a 1:N relationship between 'TestCustomEntity1' and 'TestCustomEntity2'. Now the user who has above mentioned access right in his security role will only be able to add 'TestCustomEntity2' records to 'TestCustomEntity1'.


>Levels Of Access
None
No privilages Given
User
privilages to the records owned by user or shared with the user also includes the privilages owned by the team to which belogs user.

business unit
privilages of all records owned by business unit to which the user belongs to

Parent: Child Business Unit —
privilages of all records owned in the business unit to which the user belogs  and all the child business unit subordinate to that unit

organization
privilages of all the records in the organization regardless of who owns it
-----------------------------------------------------------------------------------------------------------------------------------------------------------
System Administrator
System Administrator is the highest level role which encompasses all the privileges and has over-riding rights. The System Administrator has the authority to allow and remove access of other users and define the extent of their rights. For example, the System Administrator and the System Customizer are given access to custom entities by default while all other users need to be given access. This is the only role that cannot be edited.

System Customizer
The System Customizer role is similar to the System Administrator role which enables non-system administrators to customize Microsoft Dynamics CRM. A Customizer is a user who customizes entities, attributes and relationships.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Actions In CRM

Actions are messeges that can be defined for entity.oob provides cetrain messages like create update delete and others,but there can be cases when you want a custom action. for example:approve, reject, delegate.Through actions, we can create our own messages for any entity type.
--------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
Acces teams
these are new type of team in crm2013. basically they are different from traditional owner team we know in crm 2011 in that they are not used to grant ownership to a record but instead they grant access by sharing.
In addition, with access teams,you can create multiple teams that can each be granted varying levels of access to a single record. As we know, in CRM 2011, only a single team could be provided ownership (and thus access) to a record.

Access teams provide an alternate way of exposing and sharing records across functional teams without the need to modify or update the base security model in CRM via Business Units, Security Roles, or Teams.
---------------------------------------------------------------------------------------------------------------------------------------------------------------

Plugin Interview Questions


Secondary Entity:

"Secondary Entity use when you have to trigger plugin or retrieve record from Intersect Entity(contactleads) having records of Entities(Contact and Lead) having N:N Relationship".



When is ‘Secondary Entity’ required

The following 2 messages require the ‘Secondary Entity’ to be specified while registering a step in Plugin registration:
  • SetRelated
  • RemoveRelated
These two methods were extensively used in Dynamics CRM 4.0, but they were deprecated from Dynamics CRM 2011 onwards; although you can still use them in 2011 and 2013.


GAC Databse and Disk Deployments:
GAC
Database
Disk
  • Plugin assebly registered in GAC.
  • Plugin uploaded into the database


  • Plugin assembly saved on CRM server hard disk

  • Plugins do not backed up with database

  • Plugins backed up with database


  • Plugins do not backed up with database

  • Plugins cannot be added to the solution

  • Plugins can be added to the solution

  • Plugins cannot be added to the solution

  • Plugins needs IISRESET to refresh

  • Plugins do not need IISRESET to refresh

  • Plugins needs IISRESET to refresh

  • Does not support Dynamics CRM online

  • Supports Dynamics CRM online deployment

  • Does not support Dynamics CRM online

  • You can refer external DLL assemblies used in Plugin only if they are registered in GAC


  • You can refer external DLL assemblies used in Plugin only if they are registered in GAC


You can refer external DLL assemblies from the disk and from GAC



CRM Plugin Run In User's Context:

http://anythingcrm.blogspot.in/2013/08/crm-2011-impersonation-in-plug-ins.html

----------------------------------------------------------------------------------------------------------------------------------------
Execution Order

Execution order in plugin specifies the order, also known as rank, that plug-ins are executed within a pipeline stage Plug-ins registered with an order value of 1 are executed first, followed by plug-ins registered with an order of 2, and so on. However, if there is more than one plug-in in a stage with the same order value, then the plug-in with the earliest compilation date is called first.
------------------------------------------------------------------------------------------------------------

Event Pipeline OF Stages

http://plugincrm2011.blogspot.in/2013/01/plug-in-event-execution-pipeline.html
------------------------------------------------------------------------------------------------------------

Unsecure Configuration

Unsecure configuration information could be read by any user in CRM. Remember its public information (Eg: Parameter strings to be used in plugin could be supplied here)

Imagine that you include a plugin, plugin steps and activate them in a solution. Later solution was exported as Managed Solution to another environment. In this scenario, the supplied Unsecure configuration values would be available in the new environment
------------------------------------------------------------------------------------------------------------
Secure Configuration

The Secure Configuration information could be read only by CRM Administrators.(Eg: Restricted data from normal user could be supplied here)

Imagine that you include a plugin,plugin steps and activate them in asolution. Later solution was exported as Managed Solution to another environment. In this scenario, the supplied Secure configuration  information wouldNOT be available in the new environment. The simple  reason behind this is to provide more security to the contents of Secure Configuration.

------------------------------------------------------------------------------------------------------------


Friday, 24 August 2018

Dynamics 365 Interview Questions and Answers


  1. Plugin Deployment Options
  • Database
  • GAC
  • Disk
  1. Plugin Isolation mode
Sandbox
None
  1. Secure and unsecured configuration
  2. Impersonation
  3. Pipeline
  4. Execution order
  5.  Images in Plugins
  6. Plugin Context
  7. Create a Plugin
  8. Plugin regestartion
  9. Custom Workflow
  10. Input and output parameters in workflow.
  11. Access teams
  12. Actions
  13. Debug Plugin
  14. Dynamics 365 New features for Developers
  15. Editable grid
  16. Duplicate detection rule
  17. String map Tables 
  18. Filtered views
  19. Early binding and late binding
  20. Secondary Entity in plugin

Tuesday, 13 February 2018

Javascript Referance-Dynamics 365 9.0

JAVA script Reference for Dynamics 365 9.0

1.       Get the Attribute type

formContext.getAttribute(“Field name”).getAttributeType()

It will Returns a string value that represents the attribute type. Following are the return types

·         Boolean

·         datetime

·         decimal

·         double

·         integer

·         lookup

·         memo

·         money

·         multioptionset

·         optionset

·         string

2.       Get the format type

formContext.getAttribute(“fieldname”).getFormat()

It will Returns a string value that represents the format type. Following are the format types

·         date

·         datetime

·         duration

·         email

·         language

·         none

·         phone

·         text

·         textarea

·         tickersymbol

·         timezone

·         url

 

3.       Get the Initial Value

formContext.getAttribute(“fieldname”).getInitialValue()

Returns a value that represents the value set for a Boolean, OptionSet or MultiSelectOptionSet attribute when the form is opened.

4.       getIsDirty

formContext.getAttribute(“Fieldname”).getIsDirty()

Returns a Boolean value indicating if there are unsaved changes to the attribute value.

5.       getIsPartylist

formContext.getAttribute(“field name”).getIsPartyList()

Returns a Boolean value indicating whether the lookup represents a partylist lookup. Partylist lookups allow for multiple records to be set, such as the To: field for an email entity record.

6.       getMax

formContext.getAttribute(“Field Name”).getMax()

Returns a number indicating the maximum allowed value for an attribute.

7.       getName

formContext.getAttribute("fieldname").getName()

Returns a string representing the logical name of the attribute.

8.       getOption

formContext.getAttribute(“Fieldname”).getOption(value)

Returns an option object with the value matching the argument (label or enumeration value) passed to the method.

9.       getOptions

formContext.getAttribute(arg).getOptions()

Returns an array of option objects representing valid options for an attribute.

10.   getParent

formContext.getAttribute("fieldname").getParent()

Returns the formContext.data.entity object that is the parent to all attributes

11.   getPrecision

formContext.getAttribute(“fieldname”).getPrecision()

Returns the number of digits allowed to the right of the decimal point.

12.   getRequireLevel

formContext.getAttribute(“fieldName”).getRequiredLevel()

Returns a string value indicating whether a value for the attribute is required or recommended

13.   getSelectedOption

formContext.getAttribute(arg).getSelectedOption()

Returns the option object or an array of option objects selected in an optionset or multiselectoptionset attribute respectively.

14.   getSubmitMode

formContext.getAttribute(arg).getSubmitMode()

Returns a string indicating when data from the attribute will be submitted when the record is saved.

15.   getText

formContext.getAttribute(arg).getText()

Returns a string value of the text for the currently selected option for an optionset or multiselectoptionset attribute.

16.   getUserPrivilege

formContext.getAttribute(arg).getUserPrivilege()

Returns an object with three Boolean properties corresponding to privileges indicating if the user can create, read or update data values for an attribute. This function is intended for use when Field Level Security modifies a user’s privileges for a particular attribute

17.   getValue

formContext.getAttribute(arg).getValue()

Retrieves the data value for an attribute.

18.   isValid

formContext.getAttribute(arg).isValid();

Returns a boolean value to indicate whether the value of an attribute is valid.

19.   removeOnChnage

formContext.getAttribute(arg).removeOnChange(myFunction)

Removes a function from the OnChange event hander for an attribute..

20.   setPrecision

formContext.getAttribute(arg).setPrecision(value);

Sets the number of digits allowed to the right of the decimal point.

21.   setRequiredLevel

formContext.getAttribute(arg).setRequiredLevel(requirementLevel)

Sets whether data is required or recommended for the attribute before the record can be saved.

Note:

Reducing the required level of an attribute can cause an error when the page is saved. If the attribute is required by the server, an error will occur if there is no value for the attribute.

22.   setSubmitMode

formContext.getAttribute(arg).setSubmitMode(mode)

Sets whether data from the attribute will be submitted when the record is saved.

23.   setValue

formContext.getAttribute(arg).setValue(value)

Sets the data value for an attribute.

24.   Set LookupValue

function SetLookupFieldVaue(fieldName, id, name, entityType) {

    if (fieldName != null) {

        var lookupVal = new Array();

        lookupVal[0] = new Object();

        lookupVal[0].id = id;

        lookupVal[0].name = name;

        lookupVal[0].entityType = entityType;

                                formContext.getAttribute(fieldName).setValue(lookupVal);

    }

}

25.   Get Composite fields

formContext.getControl("address1_composite_compositionLinkControl_address1_line1")

26.   Get Control

formContext.getControl(arg);

Gets a control on the form.

27.   Get Control type

getControl(arg).getControlType();

Returns a value that categorizes controls.

ex:iframe,lookup,composite,multiselectoptionset,subgrid,notes,optionset,quickform,webresource,timewall,timecontrol

28.   Show/Hide controls or fields

formContext.getAttribute(arg).setVisible(true)//show

formContext.getAttribute(arg).setVisible(false)//hide

 

29.   Progress dialog box

OOB Feature added in D365 9.0

Xrm.Utility.showProgressIndicator(message)//to show the progress indicator

Xrm.Utility.closeProgressIndicator()//to stop the progress indicator

 

 

Source: Dynamics 365

Dynamics 365 9.0- Client API FormContext


Client API execution context

We can pass the execution context in the following way.

Defining event handlers using UI: The execution context is an optional parameter that can be passed to a JavaScript library function through an event handler. Use the Pass execution context as first parameter option in the Handler Properties dialog while specify the name of the function to pass the event execution context. The execution context is the first parameter passed to a function.




The Client API form context (formContext) provides a reference to the form or to an item on the form, such as, a quick view control or a row in an editable grid, against which the current code is executed.
Earlier, the global Xrm.Page object was used to represent a form or an item on the form. With Dynamics 365 (online), version 9.0, the Xrm.Page object is deprecated, and for you should use the getFormContext method of the passed in execution context object to return reference to the appropriate form or an item on the form.

Utilizing the formContext object rather than the Xrm.Page object

Please find the below sample code for example

Using Xrm.object
Function contactDetails()
{
         var fName = Xrm.Page.getAttribute("firstname").getValue();
    var lName = Xrm.Page.getAttribute("lastname").getValue();
}

Using formContext
function contactDetails(executionContext)
{
    var formContext = executionContext.getFormContext(); //to get the formContext

    // use formContext instead of Xrm.Page 
    var fName = formContext.getAttribute("firstname").getValue();
    var lName = formContext.getAttribute("lastname").getValue();
   
}

Dynamics 365 9.0- FormContext object model

formContext object model

Source:Dynamics 365

Sunday, 7 January 2018

List OF Replacement Client API-Dynamics 365

Source:Dynamics 365
Deprecated Client API Replacement Client API Comments
Xrm.Page Forms: ExecutionContext.getFormContext
Commands: Send it as the PrimaryControl parameter
Xrm.Page is the primary form context. If a script is run on a secondary context (grid row, quick form, related entity) then Xrm.Page will be for the wrong form context. By using alternate methods of getting the form context we allow the same script to be used without modification in all contexts.
Xrm.Page.context Xrm.Utility.getGlobalContext Allows access to the global context without going through the form context.
Xrm.Page.context.getQueryStringParameters formContext.data.attributes The formContext.data.attributes API will make retrieval of non-entity bound data consistent across entity forms, metadata-driven dialogs, and task-based flows. The data will be a combination of custom values sent using the query string and what was specified in the parameters in the openForm method.
Xrm.Page.context.getTimeZoneOffsetMinutes globalContext.userSettings.getTimeZoneOffsetMinutes Moved to globalContext.userSettings
Xrm.Page.context.getUserId globalContext.userSettings.userId Moved to globalContext.userSettings
Xrm.Page.context.getUserLcid globalContext.userSetings.languageId Moved to globalContext.userSettings
Xrm.Page.context.getUserName globalContext.userSettings.userName Moved to globalContext.userSettings
Xrm.Page.context.getUserRoles globalContext.userSettings.securityRoles Moved to globalContext.userSettings
Xrm.Page.context.getIsAutoSaveEnabled globalContext.organizationSettings.isAutoSaveEnabled Moved to globalContext.organizationSettings
Xrm.Page.context.getOrgLcid globalContext.organizationSettings.languageId Moved to globalContext.organizationSettings
Xrm.Page.context.getOrgUniqueName globalContext.organizationSettings.uniqueName Moved to globalContext.organizationSettings
Xrm.Page.data.entity.getDataXml No change in the method, but use "typename" instead of type for lookup attributes.
GridRow.getData GridRow.data GridRow is essentially a form context. This change unifies the interface of GridRow with formContext.
GridRowData.getEntity GridRowData.entity GridRowData is form data. This change unifies the interface of GridRowData with formContextData.
Xrm.Mobile.offline
parent.Xrm Earlier: An HTML web resource may interact with the Xrm.Page or Xrm.Utility objects within the form by using parent.Xrm.Page or parent.Xrm.Utility. Now: parent.Xrm.* will work if the HTML web resource is loaded in a form container. For other places, such as loading an HTML web resource as part of the SiteMap, parent.Xrm.* won’t work.
addOnKeyPress Use a custom control
removeOnKeyPress Use a custom control
showAutoComplete Use a custom control and corresponding UI
hideAutoComplete Use a custom control and corresponding UI
Xrm.Utility.alertDialog Xrm.Navigation.openAlertDialog The new signature is consistent with other APIs (openForm) and takes a new set of parameters for flexibility.
Xrm.Utility.confirmDialog Xrm.Navigation.openConfirmDialog The new signature is consistent with other APIs (openForm) and takes a new set of parameters for flexibility.
Xrm.Utility.isActivityType Xrm.Utility.getEntityMetadata The isActivityType method is synchronous so it was suitable for ribbon rules. However, the replacement method, getEntityMetadata, is asynchronous, and is not suitable for ribbon rules.
Xrm.Utility.openEntityForm Xrm.Navigation.openForm Moving navigation actions to Xrm.Navigation
Xrm.Utility.openQuickCreate Xrm.Navigation.openForm Moving navigation actions to Xrm.Navigation
Xrm.Utility.openWebResource Xrm.Navigation.openWebResource Moving navigation actions to Xrm.Navigation
Note: This API returns VOID in Unified Interface.

Create an app in Dynamics 365 | Power Apps | Dynamics 365 Customer Engagement

  Prerequisites Make sure that you have the System Administrator or System Customizer security role or equivalent permissions. Create an app...