Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, June 19, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Dynamically Setting the Account Owner at creation
Jeff L
Posts: 65
 
Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jul 07 6:40 PM
Currently by default SalesLogix sets all Account Owners to 'Everyone'.

We are now separating our contacts into two groups within the company. The separation will be via membership in two new teams.

What I want to do is to make SalesLogix look at the current user’s membership and set the Account Owner to the same team when creating new contacts for new accounts.

Is the Contact and Account creation process hidden from developers?


[Reply][Quote]
Mike Jones
Posts: 13
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jul 07 7:33 PM
Why not just set the default owner for each user?

Open Administrator, open a user, then go to the Client System tab. You can change the Default Owner setting to choose what team will own accounts created by this user.

Does this do what you need?
[Reply][Quote]
Carla Tillman
Posts: 290
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jul 07 9:55 AM
In addition to the default Owner setting; You can use the GetField function to find a User's memebership from SecRights where type like 'g'. The issue you are going to run into is when individuals belong to more than one team - You will need to decide how you are going to handle that before you write any code.

c
[Reply][Quote]
Jeff Weight
Posts: 219
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jul 07 10:07 AM
Mike, what you suggest would work, but if there are a significant number of users, and a decent amount of turnaround, and if people move between teams, it would be a pain to have to track each team member and make sure the new account is assigned to their team. This also leaves room for mistakes, and then you have to take the time to move (and probably merge) misplaced accounts. If assigning the new account/contact to the team it is being created on is a solid part of the business process, then it makes sense to make a minor change in the Add New Contact Account form script and have the new account assigned to the creating team. The only problem with this solution is that it breaks the functionality that Mike was speaking of, which is assigning the default security code - but, if the change aligns the functionality with your business process, why not?

To change this, just open up the Form called Add New Contact Account, go down to the second method called "Sub Init(intOption, strAccountID)", and you'll see where there are four different cases (Case 0 through Case 3) (Of course, this is for version 7 - if you are using an earlier version, you might have to do something different). What you need to change lies in Cases 1 and 2. Change the lines that say "lueOwner.LookupID = ", and add your own custom code, like a function, that finds the right team for the user. To do this, I created a function that runs a small SQL statement, and to find the right team, I prepended the teams with "Sales - ". That helped the SQL statement know which team ID to grab for the user.

I hope all that made sense. Like I said, Mike's solution works as well, but if you have a large number of users, modifying the code would make life easier. Good luck!
[Reply][Quote]
Jeff L
Posts: 65
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jul 07 5:01 PM
Jeff,

Thanks for the input. That is what I was setting out to do.

I am in version 6.2.xx for the time being.

I found a legacy form called Add Account Screen. This form has a look up for setting the Account. I think I can work with this.

Legacy - Yuck!

Thanks
[Reply][Quote]
Jeff L
Posts: 65
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jul 07 5:28 PM
One more thing if anyone has any input

In doing this I need to do a mass update of users on our system. I need to set them as members of two different teams. I need to create an entry in SECRIGHTS for each user to do this.

Using the API slx_DBID("SECRIGHTS") does not return a new ID using the 'Security Rights' set of new ID's from the SiteKeys table. The returned value is from 'Other'. When I use the Administrator the new record in SECRIGHTS does have an ID from the 'Security Rights’ set.

Does anyone know how to get around this problem?
[Reply][Quote]
Jeff Weight
Posts: 219
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jul 07 11:03 AM
Don't do this - team information does end up in SecRights, but it is also stored elsewhere. When you ran the slx_DBID command, the provider probably didn't return an ID for that reason. Event though it will take a while, you are much better off adding people individually using the SalesLogix Administrator.
[Reply][Quote]
Jeff L
Posts: 65
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jul 07 12:50 PM
Thanks for the advice.

Do you or anyone else know of any third party apps that interact with the Admin features that would allow for a mass update?
[Reply][Quote]
Todd Hardin
Posts: 43
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jul 07 1:30 PM
I agree with Jeff's advice to not try to write directly to the SECRIGHTS table - at least don't do it until you have run several SQL or SLX Profiler traces looking for other tables that might be updated.

There are several tables in SLX where using the real tablename with slx_DBID( ) as well as application.basicfunctions.getidfor( ) does not return IDs from the proper namespace as defined in SECRIGHTS table.

I don't have the list handy, but for thos cases you have to use an alternate name for the table in question. For SECRIGHTS table, it might be "OWNER". I may very well be wrong as that is just from memory.

Possibly someone else reading this post will have the special list of exceptions handy and will post it here.
[Reply][Quote]
Jeff Weight
Posts: 219
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jul 07 1:35 PM
Ok, I'm relenting... honestly, I don't think it matters what ID comes up, so long as it isn't a duplicate in the tables you are working in. If you are given an ID that is for a custom table, it should still work (if any of the gurus on this board see this and disagree, please say something. ) Anyway, I pulled up the profiler and added someone to a team, and I recorded the SQL that takes place in the process. Here it is:

INSERT INTO SECCODEJOINS (CHILDSECCODEID,PARENTSECCODEID,PROFILEID) VALUES ('N6UJ9A000092','F6UJ9A000018','PROF00000002')
INSERT INTO SECRIGHTS (SECRIGHTSID, SECCODEID, ACCESSID, PROFILEID, RECORDACCESS, RANK) VALUES ('I6UJ9A0004LR', 'F6UJ9A000018', 'U6UJ9A000092', 'PROF00000002', 'W', 'X')
slx_RefreshUser("NateD")

So, those are the SQL Statements - give it a whirl and see what happens - but I have never tried this, so I can't be sure it'll work perfectly.
[Reply][Quote]
Jeff L
Posts: 65
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jul 07 2:30 PM
Thanks for the effort and input from one and all.

I had looked for other records that were written and/or modified as a result of adding a user to a team. I must admit I missed the SECCODEJOINS entry. I need to look into what's going on with that insert.

Jeff, just for clarification, which version of SalesLogix did you generate these queries from.
I stated earlier that I was using 6.2. Typo, we are still using 6.1 until later this year.
[Reply][Quote]
Jeff Weight
Posts: 219
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jul 07 3:48 PM
I was wondering if maybe the version would make a difference - and it might. I generated the SQL statements on version 7.0.1. I'm not sure if anything between those two tables is any different between 6.1 and 7.0.1.
[Reply][Quote]
Todd Hardin
Posts: 43
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 07 7:41 PM
OK - I dug up some info on special cases for slx_DBIDs and/or basicfunctions.GetIDFor( )

ActualTableName UseThisName
------------------- -----------------------------
SECCODE SECPROFILE
ATTACHMENT FILEATTACH
USERNOTIFICATION USERNOTIFY
AGENTS HOSTTASK
RESOURCELIST RESOURCE
USEROPTION USERVIEW
JOINDATA JOIN
PROCEDURES PROCEDURE
SEC_FUNCTIONOWNER FUNCTIONHANDLER

[Reply][Quote]
Jeff L
Posts: 65
 
Re: Dynamically Setting the Account Owner at creationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Jul 07 10:46 AM
Thanks Todd,

What version of SalesLogix does this apply to. When I use 'SECPROFILE' with slx_DBIDs, the value returned is from group 'Other' in table Sitekeys.

Where did you get this info?
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/19/2025 10:26:13 AM