Friday 11 October 2013

MSCRM 2013 New Phone Number Format

In the December 2012 Service Update, Phone Format was added for a number of telephone number fields on OOB entities. Most phone number fields in the OOB entities were also migrated as part of the release, but some fields, such as Fax number, did not get the Phone format.

In CRM 2013, this format with the label Phone Number is being added to the list of available formats in the attribute editor.
Fields with this format type enable a click-to-call experience for your telephony provider such as Lync or Skype.

Thursday 10 October 2013

Parsing Whole Number value while Setting in MSCRM 2011

Int i;
if (Int32.TryParse(TextBox_Employees.Text, out i))
{
 mylead["numberofemployees"] = i;
}

Get selected Option Set value label in mscrm 2011 C#

                      RetrieveAttributeRequest request = new RetrieveAttributeRequest();
                       request.EntityLogicalName = targetEntity.LogicalName;
                       request.LogicalName = optionsetLogicalName;
                       request.RetrieveAsIfPublished = true;          

                      RetrieveAttributeResponse response = (RetrieveAttributeResponse)service.Execute(request);
                       PicklistAttributeMetadata picklist = (PicklistAttributeMetadata)response.AttributeMetadata;

                       var query = from option in picklist.OptionSet.Options
                                   where option.Value == int.Parse(Statusvalue.ToString())
                                   select option.Label.UserLocalizedLabel.Label;
                        SselectedOptionSetlLabel = query.FirstOrDefault().ToString();

Monday 7 October 2013

Limitations for Business Rules in MSCRM 2013

Limitations for Business Rules
·         Business rules in this release are intended to address common actions. Compared to what a developer can do using form scripts, business rules have limitations. However, business rules are not intended to replace form scripts.
·         The primary limitation you may find compared to form scripts is that all conditions in the Business rules are evaluated using AND. All the conditions must be true before the actions will be applied. There is no support for OR or Else operators to provide for more complex logic. To apply OR in your conditions you need to create separate rules for each condition you want to test. This can be done efficiently by using the Save As option and creating separate rules for each condition you want to test.
·         Business rules run only when the form loads and when field values change. They do not run when a record is saved.
·         Business rules work only with fields. Form scripts can interact with other visible elements such as tabs and sections within the form
·         When you set a field value using a business rule, any OnChange event handlers for that field will not run. This is to reduce the potential for a circular reference which could lead to an infinite loop.
·         If a Business Rule references a field that is not present on a form, the rule will simply not run. There will be no error message.
·         Calling other javascript web resources in the system via the business rule editor is not possible.

·         There is no ability to connect to external data sources.

Business Rules in MSCRM 2013 (Notes)

Miscellaneous Topics
·         Business rules cannot be run across different entities. They have to be defined within the same entity.
·         By default, the business rules are always created in a deactivated/draft state and must be activated to start executing for the form.
·         If there are multiple business rules for a control, the rules will run in the order they were added to the system. The last modified business rule runs last.
·         If you try to delete an attribute that has an active associated business rules, an error is triggered:
            "Process Error"
·         Business Rules can run on the web client (all browsers), Outlook (online and offline), iPad and CRM for tablets. However, they can only be customized through the Web Client or Outlook (Online/connected mode).
·         A new privilege for “Activate Business rules” under the customization tab for security roles has been added. Without activating the business rule first, it will not be executed.
·         Business Rules are imported/exported with the entities that they are attached to. It is not possible to export or import just a collection of business rules.
·         If there are multiple solutions, business rules will be run in the order in which the solutions were imported and the latest installed solution’s rules will run last.
·         If you package a managed/unmanaged solution, the states of the Business rules will be transported as is into the target system:
1.       activated rules will be activated
2.       deactivated rules will be deactivated

·         There are no limits on number of actions that can be attached to the business rule.