Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 2024 
 
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!
 Data & Imports Forums - SalesLogix Imports
Forum to discuss general SalesLogix import and data migration topics. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Imports | New ThreadView:  Search:  
 Author  Thread: Automated User & Account Creation
Darren O'Donnell
Posts: 12
 
Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Aug 06 3:23 PM
fiogf49gjkf0d
Hi All,

Has anyone got any experience of using SQL to create new useraccounts as well as a contact entry.

I wish to pull information from our HR system, and create the userinfo entry, and also create a contact entry for the user.

The HR system holds all the data required, but the creation of UserID's, addressID's and ContactsID's in a new record seems a black box process, and therefore I can't see a way to replicate it.

Any help would be appretiated, as I process about 50 new accounts per week, and it is getting tedious!!!

Thanks in Advance - Darren
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Aug 06 5:16 PM
fiogf49gjkf0d
If this is a one-time load situation the users can be imported from a CSV file. For informaiton on this facility look in the WorkGroup Administrator Help for "Users, importing".

[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Aug 06 3:24 AM
fiogf49gjkf0d
Or maybe you could use the Manage/SLX Windows User Matching facility in Administrator to speed this up.
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Aug 06 7:17 AM
fiogf49gjkf0d
Just looking for some clarification... I don't see the requirement for a contact record for SLX Users. Can you explain?

Also, in order to have a contact you must have an account to associate that contact to.

John G.
[Reply][Quote]
Darren O'Donnell
Posts: 12
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Aug 06 8:47 AM
fiogf49gjkf0d
Hi,

In our organisation all our staff have, or should have, a contact record.

We then associate them to other contacts and projects, at the contact, not user level.

The issue we have, is that whilst we have automated, as far as we can, the user account creation, we are now looking for a method to automate the process of setting up a contact for the user at the same time.

We have a customised association process, whech automatically associates new contacts to the user adding the contact, however, and this is where it all goes wrong for us. . .

When a new user tries to add thier own record, the system tries to associate the new contact to thier own contact, and as they are in the process of setting this up, it all goes wrong, and this then continues until we interviene, and record the corrolation between the contactid and the userid, in a custom field within the userinfo table.

Hence the requirement to set up the users contact, before they go near the system, and as stated above, we process on average 20-50 new accounts per week, so an automated method, would aid MY sanity!!

Regards

Darren
[Reply][Quote]
Snow Monkey
Posts: 214
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Aug 06 1:07 PM
fiogf49gjkf0d
What event tracking system do you have inhouse???

We have something called Knowledgesync which can track an external datasource for a record whenever it is added and supply us with the unique ID of that external system and triggers an exe everytime it finds this new unique id.That exe will then go to that HR system and get the details and then insert them into slx tables- creating accounts, contacts, users(also if neccessary).Not a big deal doing this....

but as John G suggested , you need to have an account for a contact to exist.UserIDs are however , completely independent of whatever data you are adding in the customer data tables
[Reply][Quote]
Darren O'Donnell
Posts: 12
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Aug 06 1:51 PM
fiogf49gjkf0d
Hi Nandu,

We primarly use SLX as a CRM & project recording system, we are a services based organisation, so have no goods or products.

We are happy with the process we have in place to create the new userinfo account, so userID is not an issue for us, but am I right in my interpretation of your reply, that the contactID, AddressID etc can be any format, as long as they are unique.

I thought that the value of say the contactID had more significance than being a unique identifier, and was based upon some "special" alogorythm, if this is not the case, can script the additions, generating unique ID fields myself ?

Regards

Darren
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Aug 06 2:20 PM
fiogf49gjkf0d
While your can generate the IDs yourself I think it is better to call the function that SalesLogix provides for generating unique IDs. If you do decide to generate the IDs make sure the will not confilct with IDs that SalesLogix will create.

[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Aug 06 3:06 PM
fiogf49gjkf0d
We currently have our company as an account and every user as a contact under the account. This makes a process like you're describing simple because there's an existing account and existing addressid's associated with that account can be reused since everyone works at the same physical address. If we implemented such a feature it would leave us with only worrying about the contact table. Everything would be cloned from existing records which is usually easier than trying to handle account, accountsummary, address, contact, and any other custom tables you might be including.
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 06 7:04 AM
fiogf49gjkf0d
I think I am understanding you correctly. Your saying that each contact you have in the company account is associated with ONE address record.

If that is the case it goes against the basic design of the database. Each contact record is suppose to have its own address record. I don't know how support would handle this if there were issues associated with how its being done. It probably would not be supported.

John G.
[Reply][Quote]
Darren O'Donnell
Posts: 12
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 06 7:43 AM
fiogf49gjkf0d
Hi All,

By Association, I mean a description of the relationship between parties.

Each Contact does have it's own address entry, and each Account has it's own address.

The real underlying issue, I am trying to resolve, is :-

How can I programatically, use the Name and address information stored in the userinfo table for our staff, to automatically create a NEW contact, based upon this information, I have solved the association issue, I just need to know how to create a new contact entry automatically.

Regards

Darren
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 06 8:34 AM
fiogf49gjkf0d
Darren,

I'll assume you already know the accountid. With this in hand it should be fairly easy to create a contact record for that account. The userinfo should have enough information in it to create the contact. You will have to call the GetIDfor function that returns a contact unique ID for the tablename you pass to it. Here's the description of the function from the SDK. If you haven't already, download the SDK documentation from the SLX support site.
GetIDFor
Available in The SalesLogix Client, the Support Client
Function Gets the new ID for a given table.
If you are creating a new record for a table and need the ID before posting the record to
the database, call this function to get a unique key to assign to your record. An example
of a time when you might need to know the ID is when you are creating one or more
records in a related table and need to populate the foreign key in that record and post
the records together.
Object Application.BasicFunctions.GetIDFor
Syntax GetIDFor (TableName)
Parameters TableName - the name of the table you are creating a record for.
Returns New ID or Primary Key for a new record in the table

As for automating this process. Thats a tougher question because I'm fairly certain the Administrator is not customizable. This eliminates the ability to put a hook in when a new user is created. You could create an independent process that uses the OLEDB provider to monitor the userinfo table for new records. The key here will be to have a customer field in userinfo that indicates a contact record has been created. if I remember correctly, you have this already.

My personal choice would be to use a product that does the monitoring for you. Scribe Insight is what we use internally here to do this kind of stuff. You would create a data translation specification then create a task that monitors the userinfo table. When the condition is found (lets say the userinfo.userfield1 is NULL) it would kick off the DTS that adds the appropriate contact record and updates the userinfo.userfield1 with the contactid.

Hope that helps,
John G.
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Aug 06 8:40 AM
fiogf49gjkf0d
Something else you could do is create a service in VB or C# that uses the SLX DB provider. This service would do the same thing my previous post suggests, but you would have to program everything from scratch. Resource wise its easier to use a product that already takes care of alot of the leg work for you.

John G.
[Reply][Quote]
Darren O'Donnell
Posts: 12
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Aug 06 8:56 AM
fiogf49gjkf0d
Thanks All,

You have provided me with some very interesting ways to approach this "issue".

I have managed to, using SQL, insert a new contact record, using a unique contactID, to our test DB, and all looks fine, however, I will continue to investigate the use of the Function to create the ID's, instead of my "manual" approach. (my concern is, that whilst tyhe records are being saved, that some time in the future, the fact that I have defined the ID's. will come back to haunt me!!.

I am only "skilled" in SQL, so I will need to devise a way to call the function to produce a valid ID value. I am looking at the DTS route at present, once I can get the function to generate the ID field, I would like to add this to the results of my existing SQL script. We have some .Net guys in house, I may go and bug them next!!!

Thanks for all your input guys, as a newbie, it is great to find a candid source of info/assistance.

Regards

Darren

[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Aug 06 9:54 AM
fiogf49gjkf0d
Darren,

Do you have remote users? If you do there will be major issues with synchronization if you are just using SQL to insert the contact records (and anything else for that matter). When you use the SLX OLEDB provider it will take care of all the necessary tasks to keep remote users in sync.

John G.
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Aug 06 10:40 AM
fiogf49gjkf0d
I had this situation at a client's. What we did was write a custom ExecuteSQL executable to issue SQL throught the SLX Provider. The calls the ExecuteSQL component (passing it a SQL statement) from SQL scripts, triggers, SP, etc.
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Aug 06 11:54 AM
fiogf49gjkf0d
Quote:
Originally posted by John Gundrum

I think I am understanding you correctly. Your saying that each contact you have in the company account is associated with ONE address record.


You are correct in that reusing IDs is bad. I meant to say use existing values as a template, especially since the "change account and all contact addresses that match" looks for EXACT values or else it doesn't make the necessary change. Reuse as much data as possible and if you have to make a copy, make an exact one.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Aug 06 12:12 PM
fiogf49gjkf0d
You can do just about all of this using SQL & DTS - and do it the right way too. First of all, don't generate your own ID scheme. Use what is provided and you'll be sure you're avoiding any unneeded future problems.

Secondly, what version of SLX are you on?
[Reply][Quote]
Darren O'Donnell
Posts: 12
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Aug 06 1:01 PM
fiogf49gjkf0d
Hi All,

We are using 6.2.3, we mainly use the Web Client for staff, and the Windows Client for Admin (de-dupes, merges etc)

I don't mean to be cheeky!!! but, has anyone allready written SQL/DTS for this process, or a simular process, so that I can adapt it?

In the ideal world, I would like to create the userinfo entry, it's associated address & a contact entry relecting the same details as the userinfo entry, then let the staff loose on it, to make any modifications they want, once the record is in the system. However, I am happy with the manual, process we have in place to create the userinfo entry, but would like to automate the contact creation based upon his.

Thanks again,

Darren

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Aug 06 1:34 PM
fiogf49gjkf0d
Well, you won't find anything supported that creates users. I've done my own hack for this as have many others, but SLX itself dos not expose the needed things to programatically create users. Sucks, I know and I've dished out many rants on the subject

As far as solutions for using SQL & DTS for doing imports, there is one solution I know of that does this. It is a toolkit of additional taks for SLX that will allow you to focus on SQL views to map data and minimal work in DTS. You won't likely find something pre-built that syncs users with accounts/contacts. However, you can easily do it all with out of the box SLX.

Here's your steps:

  1. Enable the AUTOINCREMENT feature for the ACCOUNT.ACCOUNTID, ADDRESS.ADDRESSID, CONTACT.CONTACTID etc fields. To do this, go to the SECTABLEDEFS table, find these fields and set the AUTOINCREMENT field to 'T'. What this means is that you won't need to create IDs for these fields, they will be automatically generated for you by simply omitting them from your import.

  2. Build a DTS package that uses the data from the user tables (USERINFO, USERPROFILE, ADDRESS, etc) as the source and then just inserts the user data to the following tables (via the SLX Provider - ie: use the SLX Provider as your connection type for your target in the DTS package)

    To create the account you must insert to these tables
    • ACCOUNT (Set ACCOUNTMANAGERID='ADMIN', SECCODEID='SYST00000001', CREATE/MODIFYUSER='ADMIN', etc)
    • ACCOUNTSUMMARY
    • ADDRESS - each record needs to get it's own row to link to


    To create the contact record you must insert to these tables
    • CONTACT
    • ADDRESS - each record needs to get it's own row to link to (separate record than the account record)


  3. As far as knowing which fields you need to populate, I would just suggest to fire up the client, create a sample record exactly as you want it to end up then go and look at the tables I mention above to see what the data looks like and you can mimic that in your import.

  4. You could even schedule the DTS package to keep the contacts/accounts in sync with the user data if you wanted (as long as you built in the ability to do updates in the DTS package so you're not creating new record each time)


Make sense?
[Reply][Quote]
Darren O'Donnell
Posts: 12
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Aug 06 5:11 AM
fiogf49gjkf0d
Thankyou, Thankyou, Thankyou!!!

I will give my development install a bashing on monday, and post my results in this post.

Thanks again for all your input guys, I look forward to playing an active role in this community, now I have found it!!!

Regards

Darren


[Reply][Quote]
Ian Fitzpatrick
Posts: 146
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jul 08 2:57 PM
Ryan,
If I'm connecting to the SalesLogix OLE DB Connection in a SQL DTS (v7.0.1), will that create TEF files for me or will I have to use Scribe to make those?

Thanks,
Ian
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jul 08 3:22 PM
Quote:
Originally posted by Ian Fitzpatrick

Ryan,
If I'm connecting to the SalesLogix OLE DB Connection in a SQL DTS (v7.0.1), will that create TEF files for me or will I have to use Scribe to make those?

Thanks,
Ian


That is right, Ian. As long as you are doing updates/inserts/deletes via the SLX Provider then the changes should sync fine (meaning the provider does handle the creation of the TEF files for you).

-Ryan
[Reply][Quote]
Ian Fitzpatrick
Posts: 146
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jul 08 4:18 PM
Wow, that is amazing! Good thing I found this old post!

I've been struggling with Scribe all day now I'm going to try using the provider and a DTS.

Just another example of SLXDeveloper saving me from wasting another few days trying to get this right. Thanks for creating this Ryan!
[Reply][Quote]
Ian Fitzpatrick
Posts: 146
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 29 Jul 08 8:56 AM
Ryan,
Do you know of a good way I create a SLX ID using SQL DTS?

Thanks,
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jul 08 1:47 AM
Easiest way is to turn Auto-Increment on for the ID field and the provider does the work for you (after restarting the SLX server services).

If you want a routine to do it, I can probably dig one out from a while back (I'm lucky to have been using SSIS recently).

Phil
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jul 08 8:03 AM
Quote:
Originally posted by Phil Parkin

Easiest way is to turn Auto-Increment on for the ID field and the provider does the work for you (after restarting the SLX server services).

If you want a routine to do it, I can probably dig one out from a while back (I'm lucky to have been using SSIS recently).

Phil


..or


'HowTo - Create a Transform for using SLX_DBIDS

If you are on a recent version of SLX, you can use the SLX_DBIDS 'stored procedure' to populate the IDs.

Create a data driven query task that grabs all of the Access data that you want to map and create a transformation to all of the fields you want to populate (excluding the IDs).

Then add another transformation - this time ActiveX scipt - that maps to the ID field. Here is some sample script to generate IDs:

'**********************************************************************
' Visual Basic Transformation Script
'************************************************************************

' Copy each source column to the destination column
Function Main()
Dim strConn
Dim objConn
Dim objCmd
Dim rs

strConn = "Provider=SLXOLEDB.1assword=""""ersist Security Info=True;User ID=admin;Initial Catalog=xxxxxx;Data Source=xxxxx;Extended Properties=""PORT=1706;LOG=ON"""

Set objConn=CreateObject("ADODB.Connection")
objConn.open strConn

Set objCmd=CreateObject("ADODB.Command")
objCmd.ActiveConnection = objConn

objCmd.CommandText = "slx_dbids('" & "tablename" & "', 1)"
Set rs = objCmd.Execute()
DTSDestination("ID Field name") = rs.fields(0).value
Main = DTSTransformStat_OK
End Function



One BIG downfall doing this.. for a large import it will burn time. If possible, use the autoinc approach:


'HowTo - Using Autoincrement

Auto-increment support for SalesLogix Primary Keys

New to as of version 6.2 SP1 of SalesLogix is support for auto-increment primary keys, using the standard SalesLogix key generation algorithms.

This support functions exactly how auto-increment (identity) columns work in SQL Server, so when a new record is added to a recordset, but the primary key value is omitted, the OLE DB Provider will automatically generate the key value. If ADO is being used, it will then populate the primary key in the recordset after calling the Update or Update Batch method of the recordset. This functionality is achieved with support for the @@IDENTITY variable in the SalesLogix OLE DB Provider.

The @@IDENTITY variable works the same as in SQL Server, where it represents the last auto-increment value executed on this connection. It is possible to even manually execute a statement like "SELECT * FROM ACCOUNT WHERE ACCOUNTID = @@IDENTITY", to retrieve the last row that was inserted with an auto-incremented key.

This functionality can be easily demonstrated in ADO tools such as ADO Explorer, by selecting an editable recordset and specifying values for all the necessary columns in the editable grid, except the primary key. As you move to the next row, to post the inserted record to the database, the primary key value will be displayed in the primary key column, assuming it was included in the SELECT statement. It is not a requirement to include the primary key in the SELECT.

Metadata in the form of a new column has been added to the SECTABLEDEFS system table, called AUTOINCREMENT. It should contain either "T", "F" or NULL and is case-sensitive. "T" is only supported for the PRIMARY KEY, and consequently it is ignored for any other columns. A value other than "T" is treated as "F".

This is represented as a new checkbox for the key column within the DB Manager of the Architect or Admin tools.
[Reply][Quote]
Ian Fitzpatrick
Posts: 146
 
Re: Automated User & Account CreationYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jul 08 10:22 AM
Awesome thanks guys! I'm going to restart the services and hopefully my autoincrement will work, if not I'm going to use this script.

Thank you!
[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 © 2024 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): 11/25/2024 5:09:31 PM