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!
 Architect Forums - Legacy Development
Forum to discuss SalesLogix legacy development including views, scripts, etc.. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Legacy Development | New ThreadView:  Search:  
 Author  Thread: Auto increment SLX ID's
Eric Hobbs
Posts: 28
 
Auto increment SLX ID'sYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Jul 08 2:23 AM
Hi. I have been playing around with the auto increment function for generating saleslogix id's for tables. I have a action script for the web client (6.2.6) which needs to insert into a table for each contact that is included as part of a campaign. This currently works by creating a record set of the contact ID's and looping through this set to insert a record for each contact. I am trying to speed this up with a bulk insert but I am having dificulty with this. I can turn on the autoincrement feature for this table by using the DB manager in the Administrator tool. Then If I create a DTS package which uses the SLX OLE DB provider I can insert records into the table and the provider correctly generates the ID's. However If I try this in the web action script , no records are inserted, and SLX Profiler shows the error message:

"The statement has been terminated. : Cannot insert duplicate key row in object 'CAMPAIGNCONTACT' with unique index 'CAMPAIGNCONTACT_PRIMARY'".

The code I am using here is:

strSQL = "INSERT CAMPAIGNCONTACT (CAMPAIGNID, CREATEUSER, CREATEDATE, MODIFYUSER, MODIFYDATE, CONTACTID, INITIALTARGET, LAUNCHDATE, RESPONDED, PROMOTIONALCODE)"

strSQL = strSQL & " SELECT '" & campaignid & "' AS [CAMPAIGNID], 'ADMIN' AS [CREATEUSER], GETDATE() AS [CREATEDATE], 'ADMIN' AS [MODIFYUSER], GETDATE() AS [MODIFYDATE], "

strSQL = strSQL & " ENTITYID AS [CONTACTID], '' AS [INITIALTARGET], GETDATE() AS [LAUNCHDATE], 'false' AS [RESPONDED], '' AS [PROMOTIONALCODE] FROM ADHOCGROUP WHERE GROUPID = '" & groupid & "'"

x = DBOpenSQL(strSQL, False)

I can't figure out what I am doing wrong. Has anyone managed to get this to work in the web client?

I have tried creating a ADO Command Object to do this , however this does not seem to work either. I keep getting an error message about the connection not supporting the command.

[Reply][Quote]
Walter Shpuntoff
Posts: 167
 
Re: Auto increment SLX ID'sYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jul 08 9:15 AM
Make sure you reboot the box with the provider on it after setting autoincrement.
For some reason, it seems not to take the change into effect otherwise.

Also - different note - CAMPAIGNCONTACT table is no longer in use by SLX. They shifted over to CAMPAIGNTARGET and use an ENTITYID instead of CONTACTID. This was done to support leads.

hth

ws
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Auto increment SLX ID'sYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jul 08 6:16 PM
I wonder how many people have been caught out by this AUTOINCREMENT idiosyncrasy ... it gets me every time. I think Ryan has made the point previously that it should just be turned on by default for all tables - seems like a damn good idea to me. I guess there may be situations where you would like to turn it off (imports maybe), but these would be quite rare.

Anyway, is a full reboot required, or can you just restart SalesLogix Server?

Phil
[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 7:41:59 AM