The new SDK for Dynamics CRM 2013 is out (see previous post for the link), and a few calls stand out when working with JavaScript:

getClient

instead of using the old isOutlookClient now we have more flexibility to determine the client. the returned values include

  • Web
  • Outlook
  • Mobile

use as follows:

context.client.getClient();

Pay attention to the list of entities where this works, as it works on those that have received an updated user interface. A list of these is provided at the end of this post.

getClientUrl

this replaces the old getServerUrl().

Use this to determine of the URL used to access the application. Distinction is made now not only between whether we are dealing with an Online or on-premise, but also if using the offline feature of the Outlook plugin.

Values returned are:

Use as follows:

context.getClientUrl();

getCurrentTheme

use for instances where Outlook is being used. This will return the selected Outlook theme the user has configured. This can be helpful when you design your web resources to match the Outlook client theme.

NOTE: Forms will not adapt to the various themes selected, only the custom web resources can be made to adapt.

Standard values returned as of now are:

  • default (web app)
  • Office12Blue (for the Blue theme)
  • Office14Silver (for the Silver or black theme)

Use as follows:

context.getCurrentTheme();

getOrgLcid

returns the selected base language for your organization. For a default English you will get 1033.

Use as follows:

context.getOrgLcid();

getUserId

return the GUID for the current user. Note that you still need a call to the web service to retrieve the Full Name if you need to display that in a web resource.

Use as follows:

context.getUserId();

getUserLcid

Returns the user selected preferred language. You can use this when customizing communication from a specific user, or any other situations where you need to compare the user selected language versus organization default language.

Use as follows:

context.getUserLcid();

getUserName

Unfortunately available only for the updated entities, but this is returning the user name of the current user.

Use as follows:

context.getUserName()

Updated Entities

The following entities have received the updated user interface to the time of this writing:

Account, Appointment, Campaign, Campaign Activity, Campaign Response, Case, Competitor, Contact, Contract, Contract Line, Email, Fax, Invoice, Lead, Letter, Marketing List, Opportunity, Opportunity Product, Order, Phone Call, Price List Item, Product, Quick Campaign, Quote, Recurring Appointment, Sales Literature, Team, Task and User.

Advertisements