Building an SData Gadget to view current users

The Sage CRM Blog

Articles of general interest about Sage CRM, the community, add-ons and general news!

Building an SData Gadget to view current users

  • Comments 4
  • Likes

In the screen shot below you can see that I have a gadget that allows me to see which users are currently logged on into Sage CRM.

This is an example of an SData gadget.  It's based on a simple view that a System Administrator can create.

SData gadgets can be built from either a table in the database like Users, Activity, Company etc. or from a custom view.  The information about which users are logged on is held in the Activity table but simply linking to the table would not filter it to just list those users currently in the system.  I need a view to do that.

I defined the view under

Administration -> Customization -> Activity

My view "vCurrentUsers" is based on the existing vUserActivity view.


CREATE VIEW vCurrentUsers 
AS 
select * from vUserActivity  WHERE Acty_Logout IS NULL and acty_sid is not null and Acty_userID is not null

This Select statement will pull back the information about users who have an active session.

 

Note: I have marked my view as an SData view.

Once the new view was created I could then use it to create my SData gadget.

To do that, I needed to modify my Interactive Dashboard and Add a New Gadget.

 

In the Gadget Wizard that followed I needed to select 'SData' as the gadget type.

The SData gadget can connect to any other Sage, or Third party application that provides fees in SData format.  I needed to link back into my install of Sage CRM with it's newly created custom view so I made sure I had ticked CRM as the SData Provider.

I could then pick my view from the alphabetical list of SData sources.

It was then a simple matter to choose the fields that I wanted to include in my output.

And then give the gadget a name before saving and it then appearing in my Interactive Dashboard.

 

Comments
  • Hi Jeff,

    After enabling my view for Sdata Access, when I go to Dashboard and I select New Gadget > SData Feed, then on step 1 I am selecting "Use SageCRM sData feed". When I click on Next, to see step 2 of 5 I get an error message in red "Error loading data".

    Could someone give me some suggestions on how to fix this error, as I am new to sData!

    Please Help!!!

  • dotnetdev: i think than is an error up to CRM 7.1f.

    With CRM 7.1h the error disappear.

    i have a problem, because if i do a view with sdata support, it doesn't appear in the dashboard, until i reboot the services. Not with a metadata refresh.

  • I hope someone sees this.  We have CRM 7.1 SP2 3.5.   We have created the view exactly as above.  When we try to create the SData gadget, the view does not appear in the entity list.  Anything we missed?

  • Your new view should appear after a Metadata Refresh.  If it still does not appear, reset IIS and restart tomcat service and try again.  This is all you should have to do.