How to Add an Extra Tab Option to the User Admin tab menu (AdminSingleUser)

1 minute read time.

A Customer had a requirement to store additional data about users that were 'Resources' in Sage CRM.

The new fields in the User table should be displayed in a page that should only be available when the user was of type 'Resource'.

Additional fields can be added to the User table very easily. The User table is listed as a secondary entity and can be changed like other secondary entities such as Notes or Campaigns.

Once the fields have been added, a new screen can be created.

Then the new fields can be added to the new screen.

This new screen can then be called from either an ASP page or from an assembly using the Sage CRM .NET API.

The page has to be added to the System Menu AdminSingleUser.

To ensure that the tab is only available on a user that is a resource the following Tab SQL clause is used

[code language="sql"]
user_resource='TRUE'
[/code]

I have discussed Tab Clause usage in the User Admin screens previously. Please see the article The SQL Tab Clause and the User Admin screens.

The new page will look like this when called.

The ASP code that produced this screen is:

[code language="jscript"]

<%
var myBlock = CRM.GetBlock("UserExtraDetailsBoxShort");
myBlock.Title = CRM.GetTrans("User_Resource","True");

var strKeyID= "Key11";
var Id = new String(Request.Querystring(strKeyID));
var intRecordId = 0;
if (Id.indexOf(",") > 0)
{
var Idarr = Id.split(",");
intRecordId = Idarr[0];
}
else if (Id != "")
{
intRecordId = Id;
}

var myRecord = CRM.FindRecord("users","user_userid="+intRecordId);
CRM.AddContent(myBlock.Execute(myRecord));
Response.Write(CRM.GetPage());
%>
[/code]

Note

When working in the User Admin area, the value Primary Key of the User record that is being viewed is contained in the query string variable 'Key11'. A listing of Key values can be found in the article Long List of Key Values for Sage CRM.