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
   Can I Bind an Attachment to a Specific Activity in Infor CRM version 7.54?
Recently I had a user ask if they could bind an attachment to a specific Activity within Infor CRM??
Posted on Jul 07, 2015 by Dale Richter to Infor CRM Questions & Answers
   Infor CRM (formerly SalesLogix) Administrator Locked Out
I thought I had seen all the issues affecting the datalink but this was a new one. We could not login t
Posted on Jun 18, 2015 by Mark Duthoy to SalesLogix Support
   How do I remove users from my Infor CRM system (formerly SalesLogix)?
I had an Administrator ask me for the steps they needed to take in order to remove a user from the Infor
Posted on May 08, 2015 by Dale Richter to Infor CRM Questions & Answers
   Infor CRM (Formerly Saleslogix) v8.1 update 03 and 05- Uncaught Error Scheduling Contact Processes
 In the Infor CRM (formerly Saleslogix) web client, under the Contact area you have the ability to s
Posted on May 07, 2015 by Kris Halsrud to Kris Halsrud's Blog
   Using Global Script functions in InforCRM
I recently had a project that required me to be able to check if a user belonged to a particular team.
Posted on May 05, 2015 by Jason Buss to Jason Buss' 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