Category: UnderscoreJS

MS CRM dynamics with Firebase(using JS)

MS CRM dynamics with Firebase(using JS)

Real-time applications provide so much functionality across so many different types of applications. There’s Google Drive real-time editing, Twitter showing new tweets and so many more.

It’s always good to learn how to make these types of techniques by learning things like socket.io

Today I am going to tell how we can use firebase with MS dynamics CRM and make real time notification model for mobile\web users.

Like status Change ,Create ,Update or some other useful requests that we performed in CRM , we can easily integrate Firebase in all that condition and Sync important data with users .

What is Firebase?

Firebase is an API service to store and sync data in real-time. What this means is that you don’t have to worry about the backend server, database, or real-time component (socket.io). All of that is handled for you by Firebase.

Just grab data from Firebase, save data to Firebase, and Firebase will worry about saving, and also syncing across all connected devices/sites. Piece of cake!

firebase

Let’s integrate firebase in CRM  !!

Before writing any code first we need to make firebase API.

AppName

After successful creating of App we get one URL like https://XXXXXX.firebaseio.com 

For more info about firebase configuration and security Please refer this link

https://www.firebase.com/docs/

What we want is to receive notifications whenever the status of case records changed.

We are using https://mscrmdynamics.firebaseio.com/Cases AppUrl for all firebase operation.For demo you can also use it.

Let write some client side code(JS) on Save Event of Case Form.

Make new Web resource type Jscript and inside it write the code which communicate with firebase on Save Event of case form.

1

In above code I used RequireJs for Injecting Firebase and underscore Scripts. we can also use downloaded files and add them in form.

Whenever status changed we send a json body with Incident(case) attributes like Incident Id, Title, Status ,Owner to Firebase and save it.

We check all case (https://xxxxxx.firebaseio.com/Cases) snapshots on our Apps that sync with our system or mobile Phones. After getting data we made our logic for showing information through notifications.

OK let’s move to the next step, we’ll call the function when record updated with Event mode value  1 or 2 or 70.

For more Information about Save Event Argument please refer Below link

https://msdn.microsoft.com/en-us/library/gg509060.aspx

Before adding/creating new case, we need to check the existance of that case in firebase that this case is not already present and if it exist then we need to update it’s status only.

2.PNG

That’s it. Now we can Sync Case record status with firebase and we can use it’s data for many purposes of sales/services/marketing.

Lets save case with status On Hold .That reflects in firebase, show in below screens

4

5

On changing status of case, it’ll immediately reflects in firebase.

6

7

Here is the link for complete code and video.

http://1drv.ms/1UpKKXo

 

Thanks for visting my blog.

Do some creative stuff in CRM  !!!  🙂