11/25/2024 6:38:50 AM
|
|
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!
Forum to discuss SalesLogix legacy development including views, scripts, etc.. View the code of conduct for posting guidelines.
|
|
|
|
Auto increment SLX ID's
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.
|
|
|
|
Re: Auto increment SLX ID's
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 |
|
|
|
Re: Auto increment SLX ID's
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 |
|
|
|
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!
|
|
|
|
|
|
|
|