Microsoft Dynamics CRM 2011 Update Rollup 16 is available

Update Rollup 16 for Microsoft Dynamics CRM 2011 is available. This article describes the hotfixes and updates that are included in this update rollup.

Check out here for complete details: Rollup 16 for Microsoft Dynamics CRM 2011 KB Article

Lot of issues resolved in Update Rollup 16, check out following issues:

  1. Emails generated by RightFax software are not tracked by CRM when using Exchange 2010.
  2. UnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #3244E1C6 when deleting a solution.
  3. Email attachments are not being deleted from the dbo.Attachment table when their parent record is deleted.
  4. SSL Offloading does not work when CRM is not using Claims/IFD authentication.
  5. OverriddenCreatedOn* attribute is missing from V3 Custom Entities.
  6. Clicking on report preview throws error on an Updated Organization from Update Rollup 6, “HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #3423D182”.
  7. When you click to create a folder for a record in CRM 2011 the SharePoint page is shown instead of the list part grid page. This causes confusion with customers.
  8. Conditional formatting breaks page navigation in view within CRM for Outlook client.
  9. When you select an email that is tracked in CRM, and you have the reading pane viewable for emails, Outlook may hang or become unresponsive. Once Outlook returns controls and becomes responsive you notice that the Track in CRM form region for the tracked in CRM email contains a large number of parties on the TO, CC, or BCC.
  10. Retry logic causes unexpected results on some OrganizationServiceProxy methods.
  11. Appointment created and deleted from the web will only be deleted from the organizers Outlook calendar. Occurs when the meeting organizer sends Outlook invitations.
  12. When you attempt to configure the outlook client for an organization and the organization friendly name matches an organization that you already have configured, you will be prompted that an organization with that display name already exists. If you then correct the display name and proceed with the configuration, configuration will succeed. However the next time that you launch the configuration wizard the wizard will fail to launch. “There is a problem communicating with the Microsoft Dynamics CRM server. The server might be unavailable. Try again later. If the problem persists, contact your system administrator.”
  13. When you have more subjects in the subject tree than can be viewed without a scrollbar, the scrollbar is not shown in IE or FireFox.The scrollbar is shown correctly in chrome.
  14. When you attempt to view html web resources in the CRM web or outlook client application by opening them from the ribbon, the web resources that are shown are old versions. This occurs even after you have published changes to the web resources. If you clear temporary internet files the web resources are shown correctly.
  15. When you create a process step using create, update, or send email step and you put in the body of the email more than 65K characters and then publish and execute the process the step will fail.
  16. Outlook Appointment Form is not saving fields updated by Silverlight / JavaScript.
  17. A 404 error is seen when accessing organization. Prior to getting 404 you deleted thousands of managed optionset values through the SDK or UI without replacing those deleted optionset values with new values. Then you published customizations.
  18. Deployment Manager and Plugin Registration performance is slow due to DC communication.
  19. Appointments and Service appointments are automatically shared with the user that shared the record.
  20. Organizations that upgraded from Microsoft Dynamics CRM 4.0 and have existing ISV.config customizations in place may encounter situations when the import of managed solutions fails to update or overwrite components in the ribbon that were created as part of the Microsoft Dynamics CRM 2011 upgrade.
  21. Searching for a contact in address book fails raising this error:”The Contacts folder associated with this address list could not be opened; it may have been moved or deleted, or you do not have permissions. For information on how to remove this folder from the Outlook Address Book, see Microsoft Outlook Help” or the data in the columns is not correct.
  22. Outlook pops up error if clicking CRM folders before the loading of CRM toolbar: “Microsoft CRM has encountered a problem and needs to close. We are sorry for the inconvenience.”
  23. Can’t renew\copy a Contract when Contract Line items dates are greater than the Contract.
  24. Custom Plugins registered against the RetrieveMultiple message and specifying “none” as the Primary Entity will fail with a SerializationException starting with the December 2012 Service Update due to an unknown Type originating from the plugins that are part of the ActivityFeeds solution.
  25. Some fields lose data on save and synchronization when focus is not moved from the field when using the CRM Outlook client.
  26. Reports do not render correctly after applying CRM 2011 Update Rollup 12.
  27. “SQL Server error” on Campaign Activity quick find search if including “channeltypecode”.
  28. Sporadically, e-mail sent from Outlook router are sent with winmail.dat attachment.
  29. Re-tracking contacts in child contact folders result in duplicate contacts after synchronization.
  30. When a form that contains a Silverlight Web Resource in Microsoft Dynamics CRM 2011, the Silverlight control fails to be resized when the user resizes the form making it difficult to access some portions of the Silverlight resource.
  31. You can access System Settings no matter the security role assigned.
  32. Users are unable to view audit history is the records they own are part of another record that they do not have sufficient privileges to access.  If they only happens for one record, users are unable to see the remaining audit details they do have access to.
  33. Summery Filter is not shown when using N:N relationship criteria.
  34. Export to Excel in Outlook fails with long relationship/entity/field names.
  35. Unable to navigate to next page records through the CRM form window using the short cut (Up/Down Arrows) in the top right corner of form.
  36. When using Process Driven forms in Microsoft Dynamics CRM 2011, users with restricted privileges may encounter “Error on Page” messages or “Error:  Unable to get property ‘trigger’ of undefined or null reference” error dialogs.
  37. Memory growth is experienced in the Microsoft Dynamics CRM Client for Outlook when the Activity Feeds Solution is present in the Microsoft Dynamics CRM Online organization.
  38. Mail Merge fails for Office 2013 Outlook clients when using Cached Mode.
  39. Currency symbol keeps as the base currency symbol in activity created by Dialog.
  40. User from 1 business unit are able to see records of other business unit when entity records between business units are merged and the records are owned by the default teams for the associated business units.
  41. If the chart pane is enabled on any view for an entity in the Outlook client, and if the user utilizes the “Email a Link” feature and selects the current view, the URL that is generated and then copied to a blank e-mail will contain invalid parameters. Clicking on this link then generates a CRM platform error, which indicates that invalid parameters were passed to the request.
  42. Offline script generated Orders change Order ID’s upon offline/online Sync.
  43. When you attempt to use a service account to impersonate users in Exchange to poll for email to be delivered into CRM using the email router, and that service account does not have a mailbox the CRM email router will not be able to proceed either with check access or during normal execution.
  44. Controls on the new driven forms introduced in the Microsoft Dynamics CRM 2011 December 2013 Service Update are not being updated with data that was modified as part of Microsoft Dynamics CRM 2011 plugin.
  45. Outlook saved views are not sorted alphabetically like in the web client.
  46. When JavaScript references a lookup via the Microsoft Dynamics CRM 2011 SDK and tries to access the EntityType property to see the record type, users with the Read Only license access will receive Undefined, instead of the proper entity name.
  47. Cannot delete managed solution because of IsMapiPrivate and LeftVoiceMail fields.
  48. Workflow failed with “The deserializer has no knowledge of any type that maps to this name”
  49. With a Decimal Number field with Precision parameter > 6,  a number beginning with 0.000000 errors on Orders. “Error. An error has occurred”.
  50. There is an error in XML document (1, 1181). when validating MAPI properties through EWS.
  51. When you use the CRM web client or CRM client for Outlook you notice memory increasing when you use the SharePoint List Web Part for CRM.
  52. Deployments with large datasets in Microsoft Dynamics CRM 2011 may suffer performance bottlenecks on default views, lookups, and queries if the EnableRetrieveMultipleOptimization registry setting is set to zero.
  53. Notes in the Outlook preview section are sorted by modified date instead of created date.
  54. In Update Rollup 13 users cannot print the whole grid page with Internet Explorer 10.
  55. When users change the field ‘Start Time’ (or any other date field) to third Sunday of October, for any year, in the Brasilia time zone.  the field is changed to 1/1/1970.
  56. Users receive “not read” receipts if <DeleteEmails> is true in the EmailAgent.xml for the Email Router.
  57. Post Polaris: the Timeout option in wait condition of workflow disappears on Edit.
  58. JavaScript errors are shown when using the CRM Web Client with DOM Local Storage disabled in IE.
  59. After applying Update Rollup 12 on the Microsoft Dynamics CRM 2011 Server, users of the offline edition of the Microsoft Dynamics CRM 2011 Client for Outlook are unable to configure their Offline Scheduled Sync settings under Personal Settings.
  60. When running an SSRS report and using certain specific locales in personal options in CRM, the report does not contain the correct format as the correct language is not selected based upon the current users locale. In this specific example end user has selected English (India) locale of 16393.
  61. When you use IE 10 and you attempt to view an email activity using the CRM email activity form, the body of the email is not fully shown. This occurs when the email that was viewed was promoted into CRM either by the Outlook client or Email router and the email body was well formed HTML.
  62. When synchronizing service appointments in Microsoft Dynamics CRM 2011 from Outlook To CRM, the activity parties on the appointments are being rescheduled even though they may not have changed.  This can potentially cause workflows or plugins to be invoked unnecessarily on the server producing inconsistent results.
  63. Multi-threaded SDK app crash with System.InvalidOperationException.
  64. Unable to view Personal E-mail Templates with EnableRetrieveMultipleOptimization is set to 2.
  65. When you attempt to choose a value from a multi parameter drop down in a SSRS report from within CRM web or Outlook client you receive a script error. “Error: No such interface supported”.
  66. You cannot import a solution which contains an out of the box chart where that out of the box chart has been deleted in the destination system.
  67. After Update Rollup 12, datetime picklist does not show the selected value when opened.
  68. After Update Rollup 12, rows of Audit History view are not aligned.
  69. Importing an updated solution version fails to import with UR12+
  70. Changing the resource on a service activity creates temporary duplicates.
  71. Service activity tooltip/color not updated for change in status reason.
  72. Deployment Manager not opening after making the failover to the mirror SQL.
  73. Cannot use print preview for draft replied emails with images after Update Rollup 12 & 13.
  74. Outlook offline reports not showing parameter pane.
  75. Unable to configure CRM outlook client when TurnOffFetchThrottling is enabled.
  76. When an error is raised when submitting the merge dialog form, and upon a second attempt to merge the data you change the selection of fields on the dialog, those changes are not submitted to the platform. The initial set of fields are used instead of updated.
  77. UI rendering issue with dynamic position option set for web hosted applications.
  78. Multi-text content is not printed correctly.
  79. When the Deployment Profile is set to Local System after Update Rollup 12 for the Email Router is applied, when you restart the service, the router hangs and will not send messages. When you enable verbose logging, you see that it does not continue checking settings. Also, the Email Router Configuration Wizard window either hangs or takes a really long time to open.
  80. Jscript error when opening field editor for Yomi field.
  81. Subgrid does not display correctly when using Internet Explorer 8.
  82. Post Update Rollup 12: prvWriteSdkMessageProcessingStep privilege required to enable some workflows.
  83. LeftVoiceMail field is missing on some custom activities post Update Rollup 12.
  84. Tracked Email Not Promoted if Opened in Inspector View from Sent Items.
  85. Voice mail messages are being rejected by the email router with the error below. These emails were tracked fine when the mailboxes were on Exchange 2007. However the issue started occurring post migrating the mailboxes to Exchange 2013. Issue is only with the emails that come as part of voice mail messages, rest of the emails are getting tracked fine.
    Instance validation error: ‘OneOff’ is not a valid value for MailboxTypeType
  86. Recurring Appointment “Data Propagation” does not list Custom attribute.
  87. Most recently viewed data disappears periodically after you have used to open more than 40 records.
  88. SQL Deadlocks when calling Associate request adding users to teams.
  89. Add activity button gets enabled for closed case even though it should be grayed out.
  90. The first tab on the form becomes visible unexpectedly overriding customizations.
  91. Filter in view does not work when for Option Set containing entries with ‘&’ character.
  92. Invalid XML when creating a campaign with special characters in view criteria.
  93. Data from related entities missing when exporting to Excel from the CRM for Outlook Client.
  94. Consider the scenario where you are creating an e-mail template. During the process copy part of a rich text or HTML formatted document and paste it into the subject line. The template creation appears to have a normal subject however the resulting e-mails from the template contain style tags.
  95. Any modification to Duplicate Detection Email Template corrupts it.
  96. When you attempt to use a view that has a condition for Owner Equals Current User’s Teams and the user does not belong to any team with a security role you receive an error: Invalid Argument.
  97. Outlook Filter settings not taken into consideration when performing a quick search.
  98. IME Settings for “Multiple lines of text” fields are not respected.
  99. Custom entity grid icon is not visible in Outlook.
  100. You receive error messages when accessing CRM fields in the CRM for Outlook client. “An error has occurred”.
  101. Set Regarding does not work on a CRM 4.0 Client connecting to a CRM 2011 Server.
  102. Save & New when editing existing Connection does not populate Connected From.
  103. When you copy and paste a tracked recurring appointment in the CRM client for Outlook, the copied recurring appointment will become untracked in CRM, however a duplicate will be synchronized to Outlook upon each manual or background synchronization.
    This occurs when the source recurring appointment contains an instance of the recurrence which has been modified or deleted and it is outside of the current effective range. For example an instance of the recurring appointment was canceled many months ago.
  104. UR12+ Spacing between dynamic fields in Processes is not maintained correctly.
  105. InvalidOperationException Errors Occur After Installing Microsoft Dynamics CRM Client For Outlook Update Rollup 11 Critical Update.
  106. SharePoint documents are stored to the root folder, not under accounts/contacts.
  107. When you create an new record and as part of the process of creating the new record you add notes to the record before performing the initial save some notes may not be created. This occurs if you click Save, Save & Close, or Save & New on the Ribbon with focus still in the body of the note that is being entered.
  108. Retry logic causes unexpected results on some OrganizationServiceProxy methods.
  109. Outlook Client quick find search box suggests search will be on current view.
  110. When opening and closing forms in Microsoft Dynamics CRM Client For Outlook, users may notice the memory of the WebFormsHost processes climb over time until the application reports it is low on memory.
  111. When installing the slipstreamed UR6 version of the CRM client for Outlook and the “Give me updates for Microsoft products and check for new optional Microsoft software when I update Windows” option is checked in Control Panel -> Windows Update -> Change Settings, Windows Update will automatically install the Critical Update (build 2903) patch during installation.  However, the Microsoft.Crm.Outlook.Diagnostics.exe executable (and potentially other files) that it installs are build 3557 instead of 2903, causing Diagnostics to crash and problems when uninstalling.
  112. Customer is using Outlook 2007 with the option ‘Send immediately when connected’ unchecked. So, when he composes a new mail, it first goes to the Outbox and when we click on Send/Receive, it goes out.
    When the CRM add-in is enabled and if we open the e-mail when it is in Outbox just to edit something, or simply to see the content and when we click on Send/Receive after that, the mail does not go out.
  113. After Update Rollup 14, the Print Preview on records does not display correctly. The footer overlaps the last tab with content.
  114. Outlook crashes when you have ShortTel Communicator and CRM client for Outlook installed.
  115. Mail merge fields not appear in word, template field definition not applied after template selection.
  116. Unable to configure CRM outlook client when TurnOffFetchThrottling is enabled.
  117. Cannot update StateCode and StatusCode of Phone Call entity via plugin code.
  118. When you type text and separate each value you want to resolve by a semi colon in a partylist field, only the first entry you types will persist after the auto resolve completes if each entry would resolve to more than 1 value.
  119. After CRM 2011 Update Rollup Up 12 lengthy form names in the Form selector are getting mixed with record data. When viewing an entity form with a display name that exceed the width of the left navigation it overflows onto the form. Before UR12 form names were simply truncated and “…” was appended. Post UR12 the form display name overflows onto the body and can over run the data. See screenshots for examples. In testing this issues is present in all IE versions, Chrome and Firefox.
  120. Clients having the Update Rollup 11 Critical Update are unable to configure if the server has attributes with a DisplayMask of ValidForAdvancedFind set to be non-searchable.
  121. Error importing org from CRM 2011 UR14 – System.Data.SqlClient.SqlException: Column names in each table must be unique. Column name ‘LeftVoiceMail’ in table ‘ActivityPointerBase’ is specified more than once.
  122. Outlook client unresponsive during startup.
  123. Copying and pasting multiple lines of text from a Word document to the body of a CRM E-mail activity record causes additional line breaks to be inserted in between each line. This issue did not occur prior to Update Rollup 12.
  124. Exporting solution does not contain relationship information if changed.
  125. Quick find within a Custom dashboard for Articles does not render any results.
  126. When you run Contact Duplicate Detection rule Full Name does not appear in the list.
  127. When the MAPI store for the Microsoft Dynamics CRM 2011 Client for Outlook is empty, updates to the cache may cause Outlook to terminate unexpectedly.
  128. When replying to e-mail activity records in the application, if a user presses the enter key in the body, followed by the delete key, a line break is inserted into the body of the form.
  129. Shared activities do not show in outlook offline mode.
  130. CRM Outlook Client Attempts To Handle Tracked Items In Shared Calendar.
  131. When you open an entity form and you attempt to navigate to a side navigation item, for example Activities or Closed Activities, the navigation may be interrupted. You may instead find that your form focus is now the first selectable field on the main section of the entity form. For example on the Account entity form, Name field is selected.
  132. Entity records containing textarea attributes such as Notes on the Reading Pane in the Microsoft Dynamics CRM 2011 Client for Outlook may cause the client to become unresponsive.
  133. Developer experience for script debugging is broken.
  134. Same Ribbon Display Rule in multiple solutions cause extremely slow form load.
  135. Script Error clicking links on side navigation before form fully loads.
  136. Wait Until condition are not being triggered if watched attribute contains NULL value.
  137. Outlook crashes when using CRM client for Outlook UR15 or UR11 CU.
  138. When you attempt to choose a value from a multi parameter drop down in a SSRS report from within CRM web or Outlook client you receive a script error.
    Error: No such interface supported
  139. Outlook client fails to load or crashes when client OrgDBOrgSettings are set.
  140. Changes made to the personal view query is not updating in Outlook client since Update Rollup 12.
  141. After installing Update Rollup 15 for CRM 2011 the Mail Merge button on the entity record Add tab does not seem to do anything when clicked.
  142. In some environments, conditions may exist when the registry keys of the Microsoft Dynamics CRM for Outlook Client are being duplicated when being read causing an exception to occur that terminates the Outlook process.
  143. This functionality changed UR12+. The custom activity form is not automatically closing when clicking on Mark Complete. The ribbon buttons are disabled and only option is to close with the X. Pre UR12 the form closed when clicking “mark as complete”
  144. Users of the Microsoft Dynamics CRM 2011 Client for Outlook may be unable to configure the client if they are utilizing a proxy PAC file.  The configuration wizard will terminate with a “Object reference not set to an instance of an object” error.
  145. Creation and deletion of business units cannot be done in a timely manner.
  146. When you are using the CRM 4 client for Outlook while connected to a CRM 2011 organization using IFD authentication you are not able to access the Organization (SOAP) endpoint or the ODATA (REST) endpoint.
    This works if you are using the CRM 2011 client for Outlook or the CRM web client.
  147. The process of assigning records from one user to another user and changing business units via the SetBusinessSystemUserRequest takes a long time to execute if the original owner owns a large number of records, for example 50K contacts. This process can also cause the tempdb log to increase in size and cause problems if you run out of disk space for tempdb.
  148. Dashboard Tab Ordering is incorrect.
  149. The owner of the child record in a merge inherits invisible rights to the master record.

Best practices for reports in Dynamics CRM 2013

The following best practices can help you to produce reports that are easier to write, comply with established standards, and execute with improved efficiency.

General best practices: This section provides best practices for creating custom SQL-based and fetch-based reports.

  • Use an existing report to create custom reports: Check whether there is an existing report in Microsoft Dynamics CRM that is close to the design that you are looking for. Download the report definition of the report, and then modify the RDL file instead of creating a new one from scratch. By doing this, you will save development time and reduce report writing errors.
  • Use Microsoft Dynamics CRM formats for currency, number, date and time, calendar: The FilteredUserSettings view contains information about currency format, date and time format, number format, negative number, starting day of the week, calendars, and other formats. Microsoft Dynamics CRM provides the fn_GetFormatStrings database function to obtain the date, time, number, currency, and calendar formats from the FilteredUserSettings view.
  • Set the page size: Reporting Services does not provide explicit page orientation, such as portrait and landscape modes, or preset page sizes. Standard Microsoft Dynamics CRM reports were designed for 8.25 x 11 (portrait) or 11 x 8.25 (landscape) page sizes that work for both US letter and A4 paper.
  • Back up your reports: Make backup copies of your reports and store them on a computer other than the reporting server.
  • Define truncation if needed: Text wrapping is the default behavior for a text box report item in Reporting Services. This means that, unless indicated otherwise, all text will wrap at the defined width of any text area and then grow vertically. If truncation is specified, a text box will truncate text at the width of the text box within the specified padding (default is 2pt left and right.) Any maximum length truncation beyond this will require custom coding. The default Microsoft Dynamics CRM reports are set up with tool tips to show static text or values from data fields when the user hovers the mouse pointer over the report item. If you use truncation, consider setting the ToolTip property to the field value so that the full text will appear when the user hovers over the truncated text.

SQL-based reports: This section provided best practices for SQL-based reports only.

  • Writing stored procedures: Adding custom stored procedures to the Microsoft Dynamics CRM database is not supported. However, you can create a separate database and write stored procedures to that database.
  • Limit text length and number of items in charts: Microsoft Dynamics CRM reports use only some of the possible chart types from Reporting Services.For any chart type, limiting label length and number of items is recommended for the chart contents to be displayed correctly. When Reporting Services displays a chart with long labels, the chart itself becomes too small to be usable. There are several ways to do this:
      • Limit your chart label length explicitly, truncating it if it is necessary.
      • Consider limiting the number of items displayed in charts.
  • Use embedded images in a report: The easiest way to use images with Reporting Services is to put the images into a database. If the images are not in a database, you can use embedded images in .png, .gif, or .jpg formats in a report. The image files that are used by Microsoft Dynamics CRM image files are located in the C:/Inetpub/wwwroot/_imgs/ico folder on a default Microsoft Dynamics CRM installation.

Improve performance of reports in Dynamics CRM 2013

General: These guidelines are applicable for both SQL-based and Fetch-based reports.

  • Limit a report to display information from a specified time period, instead of displaying all records in the Microsoft Dynamics CRM database.
  • Pre-filter a report so that the dataset is limited.
  • Calculate aggregate totals by using SQL code or aggregations in a FetchXML query, instead of passing raw data to Reporting Services and grouping.
  • Limit the number of datasets used, if possible.
  • When you compare dates, use the UTC date fields for comparisons. For example, compare the createdonutc fields and not the createdon fields in a filtered view or the FetchXML query.

SQL-based Reports: These guidelines are applicable for SQL-based reports only.

  • Don’t create a report that uses a large dataset or a complex SQL query available on-demand to all users.
  • Don’t select all columns from a Microsoft Dynamics CRM filtered view. Instead, explicitly specify the columns that you want to select in the SQL statement.
  • Use SQL stored procedures instead of inline SQL.

Dynamics CRM 2011 JavaScript debugging in Internet Explorer 11

Microsoft rebuilt the F12 tools from the ground up in Internet Explorer11. They have a brand new UI and new functionality to make your developing and debugging faster and easier.

You can access them from within a browser window by hitting F12. If your keyboard doesn’t have function keys, you can select ‘F12 developer tools’ from the ‘Tools’ menu.

You can use the Debugger tool to examine what your code is doing, when it’s doing it, and how it’s doing it. Pause code in mid-execution, step through it line-by-line, and watch the state of variables and objects at each step. New features in the Debugger tool include:

  • No-refresh debugging. Set your breakpoints  and go without reloading and losing state.
  • Tabbed document interface for easier management of multiple scripts.
  • Scrollbar that highlights breakpoints and search matches.

Development and debugging tasks it makes easier:

  • Seeing what led to a function call using the Callstack.
  • Making compressed or minified code more readable.
  • Monitoring web worker creation and  execution.

There are eight distinct tools, each with their own tab in the F12 tools interface. Here you’ll find an image of each tool, a quick summary of what it does and what’s new, and a couple of typical development or debugging tasks the tool makes easier. Check the link ‘Using the F12 developer tools in Internet Explorer 11’ http://msdn.microsoft.com/en-us/library/ie/bg182326(v=vs.85).aspx

Here are the steps how to debug Dynamics CRM JavaScript code in Internet Explorer11.

Step1:  Before you try to debug JavaScript code make sure ‘Disable script debugging (Internet Explorer)’ and ‘Disable script debugging (Other)’ options are un-checked in ‘Advanced’ tab of Internet Explorer options, these options are checked by default.

JSDebugging1

Step2:  Press the F12 key on your keyboard to open the tools or select ‘F12 developer tools’ from the ‘Tools’ menu.  You will see ‘DOM Explorer tool (CTRL + 1)’ left side, click on ‘Debugger (CTRL+3)’

JSDebugging2

Step3:  Click on ‘Open Document (CTRL+O)’ and check CRM page.

JSDebugging3

Step4:  Expand CRM page in ‘Open Document (CTRL+O)’ and check your JavaScript file is loaded and click on your JavaScript file and set the debugger wherever you want

JSDebugging4

JSDebugging5

Dynamics CRM 2013 User Interface Integration package is available

Microsoft Dynamics CRM 2013 User Interface Integration package is now available on MSDN download center.

MicrosoftDynamicsCRM2013UII.exe is available as a separate download from the SDK download page. It contains User Interface Integration (UII) solution framework, which includes a deployment guide, development guide and api reference. UII uses Microsoft Dynamics CRM for the delivery of configuration data for the Integrated Agent Desktop. It includes development and run-time components. Applications built with UII can provide unified access to customer information across different systems and can aggregate different modes of customer interactions or channels.

User Interface Integration (UII) for Microsoft Dynamics CRM uses the features of Dynamics CRM to deliver composite applications that share a common user interface. UII includes development and run-time components. Applications built with UII can provide unified access to customer information spread across different systems, and can aggregate different modes of customer interactions or channels. Unlike expensive, rip and replace approaches or risky investments on custom development, UII provides non-intrusive integration with existing systems.

Dynamics CRM 2013 SDK version 6.0.2 available

Microsoft Dynamics CRM 2013 latest SDK Version SDK Version 6.0.2 is now available on MSDN download center.

The following table lists the significant changes made to this version of the SDK.

Topic Description of changes
SDK\Bin Updated the assemblies for Microsoft Dynamics CRM 2013 Update Rollup 1. These assemblies are also compatible with the latest service update for Microsoft Dynamics CRM Online.
Handle exceptions in your code Added information about how to view the details of an exception that are hidden from the user because of insufficient permissions.
Organization entity attributes Added topic listing all the attributes that can be set for an organization.
Sample: Set and retrieve entity images New sample to show how to work with entity images.
Xrm.Page.ui control (client-side reference) Added information about a new parameter in the setNotification and clearNotification methods. The uniqueId parameter allows you to clear a specific notification set on a field, based on the uniqueId value used when the notification was set.
SDK Versions 6.0.3 and 5.0.18 coming this week Adding authentication related documentation and updated sample code to support the transition of Microsoft account subscriptions to Microsoft online services. This applies only to Microsoft Dynamics CRM Online customers.
Actions on entity records Updated metadata information.
Authenticate the user with the web services Added OAuth provider URLs.
Command bar or ribbon presentation Updated the CRM for tablets section to note that icons configured for commands won’t display and labels that are too long will be truncated.
<CrmParameter> (RibbonDiffXml) Changed description of the SelectedControlSelectedItemReferences attribute to fix an error. This option is only available when used with the <JavaScriptFunction> (RibbonDiffXml) element, not the <Url> (RibbonDiffXml) element.
Dialog limitations Added information about nested steps.
Form events (client-side reference) Added a note to the OnLoad Event section saying: Forms for Updated entities don’t reload the page after the initial save creating a record or any subsequent saves. Therefore, the OnLoad event occurs only during the initial load of the form.
Form scripting quick reference Updated this topic to include examples of new form methods.
Lookup information for the post entity and post follow entity Explained how to retrieve lookup information for the RegardingObjectId.Target property for the post entity and post follow entity.
Open forms, views, dialogs and reports with a URL Updated this topic as well as <JavaScriptFunction> (RibbonDiffXml) and <Url> (RibbonDiffXml) to add a note to say that opening entity forms in a dialog window using showModalDialog or showModelessDialog isn’t supported.
In the application, always use Xrm.Utility.openEntityForm instead of window.open to open entity forms.
Model business process flows Updated information about maximum number of activated business process flows per entity. See section: Maximum number of processes, stages, and steps.
<PageRule> (RibbonDiffXml) Added remarks to note that this rule can’t be used in Microsoft Dynamics CRM for tablets because it will always refer to one page.
Sample: Windows 8 desktop modern SOAP app
Sample: Windows 8 desktop modern OData appSampleCode\CS\ModernAndMobileApps
Added new sample applications that show how to write a Windows 8 desktop modern application that can send requests to the organization web service without linking to the SDK assemblies.
Sample: Windows 8 desktop modern SOAP app uses the Windows Azure Active Directory Authentication Library (ADAL) and the SOAP protocol.
Sample: Windows 8 desktop modern OData app uses the ADAL and the OData protocol.
<Url> (RibbonDiffXml) Added a note to this topic saying that it shouldn’t be used to open entity forms. Use <JavaScriptFunction> (RibbonDiffXml) with a function using Xrm.Utility.openEntityForm instead.
Walkthrough: Connect with CRM using Java Walkthroughs\Java2CRM Removed sample code and walkthrough. Now that Microsoft Dynamics CRM Online is transitioning from the legacy billing and administration platform to the Microsoft online services environment, this sample is no longer relevant. For more information about using CRM Online or CRM 2013 IFD with Java or other non-.NET languages, see the blog post: Use OAuth to authenticate with the CRM service.
Walkthrough: Register a CRM app with Active Directory Changed the instructions from using the Windows Azure portal to using Graph Explorer.
Write and debug scripts for CRM for tablets Added new topic to consolidate information related to writing scripts for Microsoft Dynamics CRM for tablets.
Write code for Microsoft Dynamics CRM forms Added a note to the Different Form Presentations section to say that the collaboration control found in updated entity forms isn’t accessible using form scripts. The section containing the control is available if you want to show or hide the section and the control in it.
Write scripts for composite attributes Added information to the Composite attributes in the web application section about the naming convention used to access the individual constituent controls displayed in the flyout for composite controls in the web application.
Xrm.Page.ui control (client-side reference) Updated information in the getAttribute section to note that constituent controls for quick view forms can access the value of an attribute, but any changes to the value of this attribute won’t be saved.

Microsoft Dynamics CRM 2013 Update Rollup 1 is available

Update Rollup 1 for Microsoft Dynamics CRM 2013 is available.

Check out Microsoft KB article Rollup 1 for Microsoft Dynamics CRM 2013 KB Article

Update Rollup 1 for Microsoft Dynamics CRM 2013 is available for on-premises customers. This rollup is available for all languages that are supported by Microsoft Dynamics CRM 2013. Update Rollup 1 contains stability and memory-consumption improvements.

Update Rollup 1 resolves the following issues:

  • Publishing a CRM report fails as the parent report already links to another report with same name.
  • Invalid Argument when navigating to view with related entity lookup.
  • The chart (for any other entity) does not display in Korean due to System.ArgumentException: “Value of ‘Malgun Gothic, Segoe UI, 9.5px’ is not valid for ‘units’.”
  • Script error occurs when moving from a form. “Unable to get property ‘get_filterType’ of undefined or null reference”
  • Disabling checkbox fields using the JavaScript API does not work.
  • Creating a workflow to update an appointment with fields from the regarding Lead field fails. “An unexpected error occurred.”
  • Hiding the last field of a section does not hide the section. Hiding the last field of a tab does not collapse the tab.
  • Unable to create automatic full address field workflows, as the spaces and tabs are removed if there are no other symbols like comma.
  • Using the Quick Search in Outlook and clicking Advanced Find right afterwards, the Advanced Find filter is populated with irrelevant criteria.
  • Re-import of existing solution fails with The label for base language code 1033 is not set.
  • Users cannot associate multiple records at once for N:N relationships.
  • CRM 2013 no longer warns you when you are about to delete a parent record that child records with cascade delete set on their relationships to the parent will also be deleted.
  • Unable to set a web resource to visible in script if ‘Visible by default’ not set in designer.
  • You´ve created a new business process flow and assigned that process flow to the security role of “sales manager”, “system administrator” and “system customizer”. You publish this modification and expect the process the be visible only for these security roles.Instead the BPF is hidden for all users.Instead the BPF is hidden for all users.
  • When data is entered into a form, the Save button can be clicked multiple times which results in multiple of the same record being created.
  • For a custom duration field Xrm.Page.getAttribute(“durationfield”).getValue() method returns a formatted value like30 minutes instead of 30 as expected.
  • When organization is deleted and then immediately imported back, import organization wizard unexpectedly displays a warning about version mismatch.
  • Autosave off: Entity form looses command bar after navigating away and re-opening.
  • Consider you’ve created a Business Process for cases having a related task stage with several steps and you’d like to translate all stages to different language. Your solution contains task and case entity as well as Business Process. You’re exporting translation files and try to edit those. You’ll find all stage names from case entity, but you do not find those of the related task step. Therefore you cannot translate those.
  • “Email a link” URL does not navigate to the specified entity if opened in existing browser tab.
  • Errors occur when using different country formats with currency attributes.
  • When browsing to various locations in CRM, a JavaScript exception is thrown that reports “Object expected”.
  • The .addCustomFilter javascript function does not work properly.
  • Workflow triggered on Before Delete event cannot be imported in a new organization.
  • When email activity with unresolved email recipient is created and saved, on load on email, value in TO field is hidden, field is empty.
  • Not able to see “Page Index” on subgrids from dashboards.
  • Published customization changes do not roll down to mobile client consistently.
  • Opportunity closed as won does not take custom status reason while closing.
  • Notes control shows time but not date for notes created before yesterday.
  • Mobile clients crash with UI Error: “We’re sorry. Sorry, something went wrong while initializing the app. Please try again, or restart the app”
  • Access team does not use correct metadata driven by Advanced Find view and hence fails in Mobile Clients.
  • If you create a new email message in the Microsoft Dynamics CRM 2013 web application, you discover that you cannot modify the Description field when using the latest version of Google Chrome.

SQL Generic error in Accounts Merge and Contacts Merge in Dynamics CRM 2011

Exception Message: SQL Generic error

Route Cause: Sometimes we used to get ‘SQL Generic error’ exceptions during Accounts merge or Contacts merge.  We enabled SQL Server Profiler and tried again merging for some of the failed merge accounts and contacts, traced what exception is, it is (Violation of UNIQUE KEY constraint ‘UQ_PrincipalObjectAccess’. Cannot insert duplicate key in object ‘dbo.PrincipalObjectAccess’)

For Accounts Merge: When any of Subordinate account contacts/sub accounts are shared with Master account owner, it creates a record in PrincipalObjectAccess table. When merging accounts, it is again trying to create the same record in PrincipalObjectAccess table,  since this record already exists in PrincipalObjectAccess table which causes Generic SQL error.

For Contacts Merge: It is same for contacts merge too, when Subordinate contact is already shared with Master contact owner, it creates a record in PrincipalObjectAccess table when merging contacts, it is again trying to create the same record in POA table, since this record already exists in PrincipalObjectAccess table which causes Generic SQL Error.

Solution 1: I tried to revoke those privilege records from PrincipalObjectAccess table using RevokeAccessRequest class in SDK, for some reason it is not deleting those records. It just sets AccessRightsMask and InheritedAccessRightsMark values to 0.  I guess this is what RevokeAccessRequest does, it just zero’s out the permissions shared rather than deleting the record.
Tried again merging accounts and contacts after revoking privilege records from PrincipalObjectAccess, for some reason it did not work.

Solution 2: Following solution worked for me, you can use following code do the same.

  1. Try changing the master account owner to CRM Admin user
  2. Merge the accounts/contacts
  3. Change owner back to original owner who owns before Merge.
    private void MergeFailedAccounts(CRM.SDK.Account subOrdinateAccount, CRM.SDK.Account masterAccount, CRM.SDK.Account updateContent)
        {
            IOrganizationService service = CRMHelper.GetCRMConnection();

            OrgServiceWrapper orgServiceWrapper = (OrgServiceWrapper)service;
            //Get Organization Service Context User Credentials
            string strUserDomainName = orgServiceWrapper.ClientCredentials.Windows.ClientCredential.Domain + "\\" + orgServiceWrapper.ClientCredentials.Windows.ClientCredential.UserName;
            string userFetchXML = string.Format(@"<fetch version='1.0' output-format='xml-platform' mapping='logical' no-lock='true'>
                                                    <entity name='systemuser'>
                                                        <attribute name='systemuserid'/>
                                                        <filter type='and'><condition attribute='domainname' operator='eq' value='{0}' /></filter>
                                                    </entity>
                                                </fetch>", strUserDomainName);    
            //------------------
            //1-Get CRMS Service(Admin User) UserId for changing account owner
            //------------------
            var userFetchExp = new FetchExpression(userFetchXML);
            EntityCollection userEntityCollection = service.RetrieveMultiple(userFetchExp);
            if (userEntityCollection.Entities.Count > 0)
            {
                //------------------
                //2- Change Master Account owner to CRMS Service(Admin User)
                //------------------
                AssignRequest cRMSServiceUserAssignReq = new AssignRequest
                {
                    Assignee = new EntityReference("systemuser", userEntityCollection.Entities[0].Id),
                    Target = new EntityReference("account", masterAccount.Id)
                };
                // Execute the AssignRequest
                service.Execute(cRMSServiceUserAssignReq);

                //------------------
                //3-Merge Accounts
                //------------------
                MergeRequest request = new MergeRequest
                {
                    Target = new EntityReference("account", masterAccount.Id),
                    SubordinateId = subOrdinateAccount.Id,
                    UpdateContent = updateContent,
                };

                MergeResponse response = (MergeResponse)service.Execute(request);

                //------------------
                //4- Change Master Account Owner back to orginal owner who was before Merge
                //------------------
                AssignRequest accountOwnerAssignReq = new AssignRequest
                {
                    Assignee = masterAccount.OwnerId,
                    Target = new EntityReference("account", masterAccount.Id)
                };
                // Execute the AssignRequest
                service.Execute(accountOwnerAssignReq);
            }
        }

 private void MergeFailedContacts(SDK.Contact subOrdinateContact, SDK.Contact masterContact, SDK.Contact updateContent)
        {
            IOrganizationService service = CRMHelper.GetCRMConnection();

            OrgServiceWrapper orgServiceWrapper = (OrgServiceWrapper)service;
            //Get Organization Service Context User Credentials
            string strUserDomainName = orgServiceWrapper.ClientCredentials.Windows.ClientCredential.Domain + "\\" + orgServiceWrapper.ClientCredentials.Windows.ClientCredential.UserName;

            string userFetchXML = string.Format(@"<fetch version='1.0' output-format='xml-platform' mapping='logical' no-lock='true'>
                                                    <entity name='systemuser'>
                                                        <attribute name='systemuserid'/>
                                                        <filter type='and'><condition attribute='domainname' operator='eq' value='{0}' /></filter>
                                                    </entity>
                                                </fetch>", strUserDomainName);            
            //------------------
            //1-Get CRMS Service(Admin User) UserId for changing account owner
            //------------------
            var userFetchExp = new FetchExpression(userFetchXML);
            EntityCollection userEntityCollection = service.RetrieveMultiple(userFetchExp);
            if (userEntityCollection.Entities.Count > 0)
            {
                //------------------
                //2- Change Master Contact owner to CRMS Service(Admin User)
                //------------------
                AssignRequest cRMSServiceUserAssignReq = new AssignRequest
                {
                    Assignee = new EntityReference("systemuser", userEntityCollection.Entities[0].Id),
                    Target = new EntityReference("contact", masterContact.Id)
                };
                // Execute the AssignRequest
                service.Execute(cRMSServiceUserAssignReq);

                //------------------
                //3-Merge Contacts
                //------------------
                MergeRequest request = new MergeRequest();

                request.Target = new EntityReference("contact", masterContact.Id);
                request.SubordinateId = subOrdinateContact.ContactId.Value;
                request.UpdateContent = updateContent;

                MergeResponse response = (MergeResponse)service.Execute(request);

                //------------------
                //4- Change Master Contact Owner back to orginal owner who was before Merge
                //------------------
                AssignRequest contactOwnerAssignReq = new AssignRequest
                {
                    Assignee = masterContact.OwnerId,
                    Target = new EntityReference("contact", masterContact.Id)
                };
                // Execute the AssignRequest
                service.Execute(contactOwnerAssignReq);
            }
        }

JavaScript references in Microsoft Dynamics CRM 2013

The JavaScript object model is the JavaScript API that CRM provides to enable you to customize various behaviors based on events and to access CRM data that is present on a form.

CRM 2013 fully supports the JavaScript object model from the previous version; however, it does not support the JavaScript object model from Microsoft Dynamics CRM 4.0.

Check out following reference documentation for client-side events and object models that can be used with JavaScript libraries. * marked is new in CRM 2013.

Xrm.Utility: Xrm.Utility object provides a container for useful functions not directly related to the current page. The following table lists the functions of Xrm.Utility.

Xrm.Utility
alertDialog Displays   a dialog box with a message.
confirmDialog Displays   a confirmation dialog box that contains a message as well as OK and Cancel   buttons.
isActivityType Determine   if an entity is an activity entity.
openEntityForm Opens   an entity form.
openWebResource Opens   an HTML web resource.

Xrm.Page.data: Xrm.Page.data provides an entity object that provides collections and methods to manage data within the entity form. The following tables lists the functions of Xrm.Page.data and Xrm.Page.data.entity

Xrm.Page.data
getIsValid* Do a validation check for the data in   the form.
refresh* Asynchronously refresh all the data of the form without reloading the page.
save* Saves the record asynchronously with the option to set callback functions.
Xrm.Page.data.entity
addOnSave Adds a function to be called when the record is saved.
getDataXml Returns a string representing the xml that will be sent to the server when the record is saved.
getEntityName Returns a string representing the  logical name of the entity for the record.
getId Returns a string representing the GUID   id value for the record.
getIsDirty Returns a Boolean value that indicates if any fields in the form have been modified.
getPrimaryAttributeValue* Gets a string for the value of the primary attribute of the entity.
removeOnSave Removes a function to be called when the record is saved.
save Saves the record with the options to close or new.

Xrm.Page.context: Xrm.Page.context provides methods to retrieve information specific to an organization, a user, or parameters that were passed to the form in a query string. The following table lists the functions of Xrm.Page.context.

 Xrm.Page.context
client.getClient* Returns a value to indicate which client the script is executing in.
client.getClientState* Returns a value to indicate the state of the client.
getClientUrl Returns the base URL that was used to access the application.
getCurrentTheme Returns a string representing the current Microsoft Office Outlook theme chosen by the user.
getOrgLcid Returns the LCID value that represents   the base language for the organization.
getOrgUniqueName Returns the unique text value of the   organization’s name.
getQueryStringParameters Returns a dictionary object of key   value pairs that represent the query string arguments that were passed to the   page.
getUserId Returns the GUID of the SystemUser.Id value for the current user.
getUserLcid Returns the LCID value that represents the provisioned language that the user selected as their preferred language.
getUserName* Returns the name of the current user.
getUserRoles Returns an array of strings that represent the GUID values of each of the security roles that the user is  associated with.
isOutlookClient (Deprecated) Returns a Boolean value indicating if the user is using Microsoft Dynamics CRM for Outlook.
isOutlookOnline (Deprecated) Returns a Boolean value that indicates whether   the user is connected to the CRM server.
prependOrgName Prepends the organization name to the   specified path.

Xrm.Page.ui:  Xrm.Page.ui provides collections and methods to manage the user interface of the form. The following table lists the functions of Xrm.Page.ui

Xrm.Page.ui
clearFormNotification* Remove form level notifications.
close Method to close the form.
formSelector.getCurrentItem Method to return a reference to the   form currently being shown.
formSelector.items A collection of all the form items accessible to the current user.
getViewPortHeight Method to get the height of the viewport in pixels.
getViewPortWidth Method to get the width of the viewport   in pixels.
getCurrentControl Get the control object that currently has focus.
getFormType Get the form context for the record.
navigation.items A collection of all the navigation items on the page.
setFormNotification* Display form level notifications.
refreshRibbon Re-evaluate the ribbon data that controls what is displayed in it.
 Collections
Xrm.Page.data.entity.attributes All attributes on the page.
Xrm.Page.ui.controls All controls on the page.
Xrm.Page.ui.formSelector.items All the forms available to the user.
Xrm.Page.ui.navigation.items All the items in the form navigation   area.
Xrm.Page.ui.tabs All the tabs on the page.
Xrm.Page Attribute.controls All the controls for the attribute.
Xrm.Page.ui Section.controls All the controls in the section.
Xrm.Page.ui Tab.sections All the sections in the tab.
 Collections Methods
forEach Apply an action in a delegate function to each object in the collection.
get Get one or more object from the collection depending on the arguments passed.
getLength Get the number of items in the collection.

Attributes: Attributes store the data available in the record. Attributes are available from the Xrm.Page.data.entity.attributes collection. To access an attribute you can use the Xrm.Page.data.entity.attributes.get method or the shortcut version Xrm.Page.getAttribute. Following table shows how you can query attribute properties to understand what kind of attribute it is or change the behavior of the attribute.

 Xrm.Page.getAttribute(“…”)
getAttributeType Get the type of attribute.
getFormat Get the attribute format.
getIsDirty Determine whether the value of an   attribute has changed since it was last saved.
getIsPartyList Determine whether a lookup attribute   represents a partylist lookup.
getMaxLength Get the maximum length of string which   an attribute that stores string data can have.
getName Get the name of the attribute.
getParent Get a reference to the Xrm.Page.data.entity object that is the parent to all attributes.
getRequiredLevel Returns a string value indicating   whether a value for the attribute is required or recommended.
getSubmitMode Sets whether data from the attribute   will be submitted when the record is saved. always / never / dirty
getUserPrivilege Determine what privileges a user has   for fields using Field Level Security.
getValue / setValue Gets or Sets the data value for an   attribute.
setRequiredLevel Sets whether data is required or   recommended for the attribute before the record can be saved. none / required  / recommended
setSubmitMode Returns a string indicating when data   from the attribute will be submitted when the record is saved.
Number Attribute Methods
getMax / getMin Returns a number indicating the maximum   or minimum allowed value for an attribute.
getPrecision Returns the number of digits allowed to   the right of the decimal point.
setPrecision* Override the precision set for a number attribute.
DateTime Attribute Methods
setIsAllDay* Specify whether a date control should  set a value including the entire day.
setShowTime* Specify whether a date control should  show the time portion of the date.

Controls: Controls represent the user interface elements in the form. Each attribute in the form will have at least one control associated with it. Not every control is associated with an attribute. IFRAME, web resource, and subgrids are controls that do not have attributes. Controls are available from the Xrm.Page.ui.controls collection. To access a control you can use the Xrm.Page.ui.controls.get method or the shortcut version Xrm.Page.getControl. The following table lists the functions of Controls.

Xrm.Page.getControl(“…”)  
clearNotification* Remove a message already displayed for   a control.
getAttribute Get the attribute that the control is   bound to.
getControlType Get information about the type of   control.
getDisabled / setDisabled Get or Set whether the control is   disabled.
getLabel / setLabel Get or Set the label for the control.
getName Get the name of the control.
getParent Get the section object that the control   is in.
getVisible / setVisible Get or Set a value that indicates   whether the control is currently visible.
setFocus Sets the focus on the control.
setNotification* Display a message near the control to   indicate that data is not valid.

 Lookup Controls: The following table lists the functions of Lookup Control.

addCustomFilter* Use fetchXml to add additional filters   to the results displayed in the lookup. Each filter will be combined with an   ‘AND’ condition.
addCustomView Adds a new view for the lookup dialog   box.
addPreSearch* Use this method to apply changes to   lookups based on values current just as the user is about to view results for   the lookup.
getDefaultView / setDefaultView Get or Set Id value of the default   lookup dialog view.
removePreSearch* Use this method to remove event handler

OptionSet: The following table lists the functions of OptionSet Control.

getInitialValue Returns a value that represents the   value set for an optionset or boolean when the form opened.
getOption[s] Returns an option object with the value   matching the argument passed to the method.
getSelectedOption Returns the option object that is selected.
getText Returns a string value of the text for   the currently selected option for an optionset attribute.
adoption / removeOption Adds or remove an option to an option   set control.
clearOptions Clears all options from an Option Set   control.

IFRAME and Web Resource Controls:  An IFRAME control allows you to include a page within a form by providing a URL. An HTML web resource added to a form is presented using an IFRAME element. Silverlight and image web resources are embedded directly within the page. The following table lists the functions of IFrame or Web Resource controls.

getData / setData Get or Set the value of the data query   string parameter passed to a Silverlight web resource.
getInitialUrl Returns the default URL that an I-frame   control is configured to display. This method is not available for web   resources.
getObject Returns the object in the form that   represents an I-frame or web resource.
getSrc / setSrc Get or Set the current URL being   displayed in an IFrame or web resource.

Sub-Grid Control: Sub-Grid control has refresh method. We can use this method to refresh data displayed in a Sub-Grid.

refresh Refreshes the data displayed in a Sub-Grid.

OnChange Event: There are three methods you can use to work with the OnChange event for an attribute.

addOnChange / removeOnChange Sets or remove a function to be called   when the attribute value is changed.
fireOnChange Causes the OnChange event

Get Form types and modes in Dynamics CRM 2013

getSaveMode(), returns a value indicating how the save event was initiated by the user. The following table describes the supported values returned to detect different ways entity records may be saved by the user in CRM 2013.

execObj.getEventArgs().getSaveMode();
Event Mode Value
Save 1
Save and Close 2
Deactivate 5
Reactivate 6
Send (Email) 7
Disqualify (Lead) 15
Qualify (Lead) 16
Assign (user or team owned entities) 47
Save as Completed (Activities) 58
Save and New 59
AutoSave 70

getFormType(): Method to get the form context for the record. The following table lists the form types that correspond to the return value.

Xrm.Page.ui.getFormType();
Form Type Value
Undefined 0
Create 1
Update 2
Read Only 3
Disabled 4
Quick Create 5
Bulk Edit 6
Read Optimized 11