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
   Mobile 3.0.3 for Saleslogix v7.5.4, v8.0.0 & v8.1.0 is now available!
Saleslogix Mobile v3.0.3 is now available in the customer portals. This update addresses all issues int
Posted on Apr 14, 2014 by Scott Weber to SalesLogix Product Blog
 
   Editing Filters in Saleslogix Web Client 8.0
Is it possible to add or remove Saleslogix filters from the List view in Accounts?
Posted on Apr 08, 2014 by SalesLogix Support to SalesLogix Questions & Answers
 
   Creating a Unique Saleslogix table ID in a SQL Function
A couple of months ago Ryan Farley wrote an article about how to use a SQL stored procedure to create a S
Posted on Mar 25, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Saleslogix Integration with Google - WOW!
Saleslogix will be releasing their Google Integration this month and from what I have seen, it is fantast
Posted on Mar 18, 2014 by Scott Weber to SalesLogix Product Blog
 
   Using a Test Plan
So you have approved the Statement of Work (SOW) for some modifications and are awaiting the delivery of
Posted on Mar 13, 2014 by George Jensen to George Jensen's Blog
 
Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2014 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