You are here

Application Development

Triggering an Event in Another System Immediately from Salesforce

I’ve been working on integrations between Salesforce and another system. Our standard “pattern” has been to use outbound messages to send a message to our ETL software. It’s been working well – at least until we hit an integration where the performance wasn’t fast enough because it involves a shopping cart operation, often times with someone on the phone waiting for an immediate answer.

T-SQL Sequence

One of the new features introduced with SQL 2012 is the Sequence statement and is a welcome addition for auto-number generation. They are similar to the identity property of a column, but handled at the database-level and not bound to a particular table. With earlier versions of SQL Server, you had to settle for an identity property or create your own custom logic to do it.

CRM 2015 Gotchas: Native N:N Relationship Behavior on the Tablet App

One of our projects has a simple N:N relationship between an entity and itself, as an easy way for a user to associate possible duplicate records with one another. In the browser and in Outlook, this functionality works well; the user can either add an existing record via a subgrid on the form or through the associated view. In the tablet app, however, a very vague error is thrown the moment the user selects the record to add:

The Mustache of JavaScript HTML Generation

Especially on web pages that rely heavily on front end logic, the problem arises where we have to generate dynamic HTML and inject it into the DOM via JavaScript. JavaScript code that generates HTML markup is not only hard to read, but it also violates the concept of separating driving logic and presentation of a web page. 

I personally have seen a lot of clunky JavaScript code that builds HTML based on dynamic data (e.g. JSON received by AJAX calls). Here is an example of how dynamic HTML generation can get out of hand:

Convert XML to .NET Classes

Even though JSON is more frequently used for data interchange now, I still find myself dealing with the serialization and de-serialization of XML data from time to time. In .NET, building the classes to support the XML structure can be time consuming and tedious for complex data.

Creating a Date From MS CRM JSON

I was recently working with MS CRM and returning a collection of objects. Each object has a date property. Of course, when I looked at the value of the date that was being returned, it wasn't really usable. Below is an example of one of the objects that was returned:

[code language="javascript"]

{

    "__metadata": {

        "uri": "http://crm2013dev:5555/CompanyXYZ/XRMServices/2011/OrganizationData.svc/new_widgetSet(guid'9fdaa01d-0604-e511-80f3-00155d010210')",

MS CRM - Trigger Event After Save

On a CRM form, we are given two event options, OnLoad and OnSave. You would probably think that OnLoad would fire everytime the form loads (even after a save), but if you're using CRM 2013 you would be mistaken. The OnLoad event only fires on the first load, and OnSave fires right before a save, so you'd have to get a bit creative in order to fire the event after the save.

CRM 2015 for Mobile – Customizing the Subgrid Command Bar

When it comes to CRM 2013/2015, the difficulties in customizing a subgrid’s command bar are well known. You can’t add buttons and you can’t change the image or tooltip for the existing buttons, so you’re left with replacing only the functionality of the existing buttons or requiring your users to visit the associated view to use a custom button.

Applying input rules using JQuery extensions

A common scenario for web-based form is real-time processing of user input. The goal is that processing could perform filtering of certain characters. A perfect example is a form field that should only accept numbers. Prior to HTML 5, that functionality was not natively supported and required additional JavaScript to do the heavy lifting. Even today, we cannot rely on HTML 5 features when creating a webpage with backwards compatibility in mind, therefore we still need to process the user input with JavaScript to ensure proper filtering on older browsers. 

MVC Email Generation with Postal

It's been a long time since I needed to generate an email with portions of the content coming from fields in a model/entity used in a web application. There are a several ways to do this with the most basic being a mail merge of sorts from a text file or string with embedded placeholders ({0}, {1}, {2}) for the replacement values. Since I am using MVC, I wanted to see if there was an easier approach leveraging Razor views and ran across the Postal library, which is also available via NuGet.

Pages