Login / Register  search  syndication  about

          Jason Buss' Blog

Jason Buss on SalesLogix development & customization, SQL, and more.

Using Team Membership for Dynamic view display

On occasion, I've had requirements to display different 'versions' of a form for one group of users over another.

While field level security can be used to limit read\write access to fields by using security profiles, another option is to use team membership to determine how to configure controls on the view itself.  In this example, I'll outline how to show different configurations of the Account Detail view based on a users team membership.

I've added a new team called 'Sales' to SalesLogix, and populated the team with a number of users.  First of all, we'll need to determine if the currently logged in user belongs to the new 'Sales' team in SalesLogix.  This requires a basic knowledge of how that information is stored in SalesLogix.  The SECCODEID table contains definitions for teams in SalesLogix.  The table 'SECRIGHTS' funcitons as a hash-table, containing a SECCODEID value along with a ACCESSID value which contains a userid for a user which belongs to the team. 

Within the WhenChange event of the Account Detail view I'm using the GetField function contained in the SLX Data Access script already included in the view to get a count from secrights where the accessid is the currentuserid and the seccodeid matches the team's seccodeid that we are looking for.  The GetField function simply returns a value from a SQL statement passed to the function.  GetField takes three parameters; Field, Table and a Where clause for the statement.  I've assigned the Table and Where parameters to variables here for readability:


    Dim bIsSales
    Dim sSqlTable
    Dim sSqlWhere

    sSqlTable = "secrights a inner join seccode b on a.seccodeid = b.seccodeid"
    sSqlWhere = "b.seccodesc = 'Sales' and a.accessid = '" & Application.BasicFunctions.CurrentUserID & "'"
    bIsSales = False

    If GetField("count(a.secrightsid)", sSqlTable, sSqlWhere) Then
        bIsSales = True
    End If

At this point, the bIsSales variable will be True if the currently logged in user belongs to the Sales team.  All we need to do now is adjust properties in the Account detail view via code based on the value of that variable.  In this case, I just want to hide the fields normall contained on the right hand side of the view, and replace them with a couple of Sales-specific fields.  The easiest way to do this is to cut and paste those fields onto a new panel.  I also created a panel to contain the Sales fields.  The bevel properties of the panels have been set to None so that they do not contain borders.


Once the panels are created, I move the Sales panel so that it is in the same position as the panel containing the standard fields.  All we need to do now is to show  the panel we want while hiding the panel we don't: (again, this is contained on the WhenChange event of the form)

    pnSalesPanel.Visible = bIsSales
    pnSalesPanel.Enabled = bIsSales
    pnStandard.Visible = not bIsSales
    pnStandard.Enabled = not bIsSales

That's all there is to it!  This is a very simple example of modifying the form, but your options are pretty much limitless.  Using the Visible and Enabled properties of individual controls along with their Left and Top properties, you can include code to format the view in any way you would like.  Feel free to experiment.


Thanks for reading.  I hope you find this example helpful.  Smile

What's This?
Bookmark and Share

About Jason Buss

   Jason is a senior application developer with Customer FX.

Related Content
   InforCRM (formerly Saleslogix) Mobile - Clearing Out Earlier Customizations
If you started with an earlier version of SalesLogix Mobile, let's say version 7.5.4, and customized
Posted on Mar 30, 2015 by Mark Duthoy to SalesLogix Support
   How do you set the Base Directory when Deploying your Web Client on Infor CRM 8.1?
Question:How do I make sure my Base Directory is set correctly on Infor CRM ? Recently I had a custo
Posted on Mar 06, 2015 by Dale Richter to Infor CRM Questions & Answers
   How do I fix a corrupt Picklist in Infor CRM version 8.1?
I had a user ask how to fix a corrupt picklist. The picklist did not show any values when trying to e
Posted on Feb 06, 2015 by Dale Richter to Infor CRM Questions & Answers
   Creating a Searchable & Filterable ComboBox in Infor CRM (Saleslogix) Web Client
I've had a few posts lately covering the ComboBox control in the Infor CRM (Saleslogix) Web Client. T
Posted on Feb 05, 2015 by Ryan Farley to Ryan Farley's Blog
   Limiting the Height of the Infor CRM (Saleslogix) ComboBox Popup
In my last post, I discussed how the Infor CRM (Saleslogix) ComboBox is a Dijit Select form widget. This
Posted on Jan 29, 2015 by Ryan Farley to Ryan Farley's Blog

No Comments

Leave a Comment

All contents Copyright © 2015 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register

Upcoming Workshop Dates

No scheduled workshops