Building an SData Gadget to view current users

1 minute read time.

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.

Anonymous