Thursday, October 15, 2015

Get or Set values of all data types using javascript in MS CRM




Single Line of Text or Multi Line of Text:

Set:

Xrm.Page.getAttribute("attribute logical name").setValue("Test");

Get:

Xrm.Page.getAttribute("attribute logical name").getValue();


Two Options:

Set:

Xrm.Page.getAttribute("attribute logical name").setValue(1);

Two options will accept either 1 or 0.

Get:

Xrm.Page.getAttribute("attribute logical name").getValue();

Above code snippet will return “true” in case set value is “1” and “false” if set value is “0”

Xrm.Page.getAttribute("attribute logical name ").getText();

This code snippet will returns the text we have selected.

OptionSet:

Set:

Xrm.Page.getAttribute("attribute logical name").setValue(1);

Get:

Xrm.Page.getAttribute("attribute logical name").getValue();

Above code snippet will return the selected option value.

Xrm.Page.getAttribute("attribute logical name ").getText();

Above code snippet will returns the text of option we have selected.

DateTime:

Set:

Xrm.Page.getAttribute("attribute logical name ").setValue(new Date("12-31-2014"));

Get:

Xrm.Page.getAttribute("attribute logical name ").getValue();


Lookup:

Set:

Xrm.Page.getAttribute("lookupname").setValue([{ id: "record Guid", name: "record name (Optional)", entityType: "entity logical name" }]);


Get:

var lookupVar = Xrm.Page.getAttribute("attribute logical name").getValue();

var ID= lookupVar[0].id;

var Name= lookupVar[0].name;

var LogicalName= lookupVar[0].entityType;


Currency or Decimal:

Set:

Xrm.Page.getAttribute("attribute logical name").setValue("100.00");

Get:

Xrm.Page.getAttribute("attribute logical name").getValue();

Wednesday, October 14, 2015

Retrieve all attributes using FetchXML in MS CRM




Below code snippets gives an example on how to retrieve all the attributes from an entity using fetch xml.

<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' count='1'>
  <entity name='new_account'>
    <all-attributes />
    <order attribute='createdon' descending='true' />
    <filter type='and'>
      <condition attribute='new_name' operator='eq' value='Test' />
    </filter>
  </entity>

</fetch>

<all-attributes />  will fetch you all attributes in fetch XML.








Tuesday, October 13, 2015

Ticker Symbol Field in MS CRM




Ticker Symbol is the new feature we are having in MS CRM 2015. This is very useful when we want to navigate the link to respective stocks.


Ticker Symbol:   This creates a stock ticker symbol in all capital letters. Click the symbol to open information about the stock in the user's default browser. By default, the MSN website opens.


Below is the small screen I have developed, and entered Ticker Symbol as “GE”. When I click on this link, it will navigate you to second screen which will have all stock’s related information of GE
















































You may like below posts

Improving MS CRM Performance

Performance Center in MS CRM 2013

date and time field behavior in MS CRM

Upsert in MSCRM

Locking mechanism in MS CRM

Themes in MS CRM

Enable Tracing in MS CRM

Calculated Field in Dynamics CRM 2015


IME Mode in MS CRM

Themes in MS CRM





With MS CRM 2015 udpate 1, we get a new feature of Theme under Customizations as shown below screen.











With this feature we can change the Theme of CRM screen as we required. Once we click on Theme, it will navigate you to the Themes view and there we can add new theme. Below is the sample theme I have created.


















Once all the colors have been configured we can check the preview of the screen by clicking on “Preview” button on command bar. For my sample them, screen will be looks like below.


You can exit from the preview by clicking on Exit Preview button and if everything is looks good , you can publish the Theme by clicking on Publish button.
























You may like below posts

Improving MS CRM Performance

Performance Center in MS CRM 2013

date and time field behavior in MS CRM

Upsert in MSCRM

Locking mechanism in MS CRM

Ticker Symbol Field in MS CRM

Enable Tracing in MS CRM

Calculated Field in Dynamics CRM 2015


IME Mode in MS CRM

Removing welcome screen in MS CRM




Whenever user logs into the application you will see the welcome screen, may be it is difficult every time to close the screen, so we can remove this welcome screen by changing the configuration in Settings.


MS CRM-> Settings - > Administration->System Settings


Under General tab of System Settings we have option of Set whether users see welcome screen. We need to set this option as “NO” as shown in below screen





























You may like below posts

Improving MS CRM Performance

Performance Center in MS CRM 2013

date and time field behavior in MS CRM

Upsert in MSCRM

Locking mechanism in MS CRM

Ticker Symbol Field in MS CRM

Themes in MS CRM

Enable Tracing in MS CRM

Calculated Field in Dynamics CRM 2015


IME Mode in MS CRM


Audit User Acces in MS CRM





Monitoring the user access details are very crucial in any project. MS CRM provide us new feature called Audit User Access


Enabling Audit User Access:


MS CRM -> Settings -> Auditing->Global Audit Settings->


Under Auditing tab we need to check Start Auditing and Audit User Access fields.

















We can view the Audit summery under Audit Summary View as shown in below screen.

















You may like below posts

Improving MS CRM Performance

Performance Center in MS CRM 2013

date and time field behavior in MS CRM

Upsert in MSCRM

Locking mechanism in MS CRM

Ticker Symbol Field in MS CRM

Themes in MS CRM

Enable Tracing in MS CRM

Calculated Field in Dynamics CRM 2015


IME Mode in MS CRM

Duplicate detection rules in MS CRM

Maintaining the unique information in database is very crucial. Before, creating a record, we generally check whether same record is exist or not in database, if not we are allowing user to insert the record. For this we are generally writing custom code.

MS CRM has a feature called Duplicate detection. We can configure this feature by creating duplicate detection rules.

Scenario: I have a custom entity called State. And, I would like to create a duplicate detection rule on this entity such that same state name cannot be inserted into the system.



For this requirement, I have to create a duplicate detection rule first. Below is the navigation path to duplicate detection rules


MS CRM - > Settings - > Data Management -> Duplicate Detection Rules -> New

Screen will be looks like below






















Because of my duplicate detection on same entity, both Base Record Type and Matching Record Type pointing to same entity (in this case - State)


We can put condition whether Case sensitive should be consider while duplicate check by select or un-select “Case-sensitive” field. By default it is No. i.e it will not take Case-sensitive into consideration.


And, we can put condition whether duplicate detection rules should consider inactive records or not by selecting “Exclude inactive matching records” field. By default it is unselected. i.e it will consider inactive records.


And, when it comes to fields

I kept Name field criteria should be “Exact Match” and kept “Ignore Blank Values” as Selected. So it will looking for exact match with in Name fields. If it finds the field it will alert you with a screen which will contains all the matching records as shown in below screen



















Now, it is up to the user like

1. User will cancel the current record and edit

Monday, October 12, 2015

Action name is not appearing or available in Plugin Registration tool MS CRM

Actions are the new concepts we are having in latest versions of MS CRM. Beauty of actions are we can call actions from Javascript or plugin. For, this we need to register our action in Plugin Registration tool against the entity on which action should execute.

Sometime, action name will not be appear or available in Plug-in Registration tool, for this we need to re-open the plug-in registration tool i.e, close the tool and reopen it.





You may like below posts

Improving MS CRM Performance

Performance Center in MS CRM 2013

date and time field behavior in MS CRM

Upsert in MSCRM

Locking mechanism in MS CRM

Ticker Symbol Field in MS CRM

Themes in MS CRM

Enable Tracing in MS CRM

Calculated Field in Dynamics CRM 2015


IME Mode in MS CRM

Monday, October 5, 2015

Maxminum Fields in MS CRM

Javascript functions of Xrm.Page.data

There are certains functions in Xrm.Page.data context , which are very useful in implementation of CRM projects.

1. Xrm.Page.data.entity.getId();

this function will returns the value of primary key of current record.

2. Xrm.Page.data.entity.getPrimaryAttributeValue();

this function will returns the Primary Attribute values. In this context Primary attribute is nothing but "name" field. so, the above function will returns the whatever the value "name" field contains.

3. Xrm.Page.data.entity.getDataXml();

this function will returns an XML which contains all the attributes whose values are changes while saving the form.

4. Xrm.Page.data.entity.getEntityName();

this function will returns the entity name of the current record.

5. Xrm.Page.data.entity.getEntityReference();

this function will returns the lookup object of the current record like below example.

Xrm.LookupObject {entityType: "new_state", id: "{28AC4FCF-3B22-E511-80D9-3863BB349780}", name: "AP"}




You may like below posts

Improving MS CRM Performance

Performance Center in MS CRM 2013

date and time field behavior in MS CRM

Upsert in MSCRM

Locking mechanism in MS CRM

Ticker Symbol Field in MS CRM

Themes in MS CRM

Enable Tracing in MS CRM

Calculated Field in Dynamics CRM 2015

IME Mode in MS CRM