Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 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!
 External Development Forums - SalesLogix OLEDB Provider
Forum to discuss using the SalesLogix OLE DB Provider from external applications (including usage of built-in provider procedures). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix OLEDB Provider | New ThreadView:  Search:  
 Author  Thread: insert from web site
David Ogles
Posts: 51
 
insert from web siteYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Oct 07 10:04 AM
What is the best way to create an ID for an SLX table in an external web app? we are trying to insert a contact from the web site. I am thinking that there is a "slxcreateidfor" but I'm not sure.

thanks,
dave
[Reply][Quote]
Thomas Aussem
Posts: 57
 
Re: insert from web siteYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Oct 07 12:39 PM
Hi David,

Ryan has written an excellent article about that point, see http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=87 for more details.

From my point of view, it's better to create a new LEAD, if you're using SLX 7.x or the Marketing Feature Pack within SLX 6.2. After creating a new LEAD you can convert it to a qualified contact. That way avoids a lot of duplicate entries in your CONTACT/ACCOUNT tables.

Best regards,
Thomas
[Reply][Quote]
SpongeBob
Posts: 1
 
Re: insert from web siteYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Oct 07 2:46 PM
I'm connecting to SLX thru the provider using ColdFusion 7.

In CF I've used a createObject method that connects to the OLEDB Provider. In order to get a primary key for insert statements I had to convert the slx_dbids method to a string and Execute the command on the CF Object.

Once you get the results from the Execute command you will need to convert it via the GetString() method on the returned obj.

Then you can run the SQL via the Execute(SQL) command on the ADODB obj.

But remember you have to TRIM the string or it will throw a truncated error in CF.

Hope this helps!

Here is an example...



MyConnection = createObject("COM", "ADODB.Connection");
MyRecordSet = createObject("COM", "ADODB.RecordSet");

MyConnection.Open("YOUR CONNECTION STRING");
table = "OPPORTUNITY_CONTACT";
newid = MyConnection.Execute(TOString("slx_dbids('{0}', 1)"),table);
tmp = TRIM(newid.GetString());

SQL = "INSERT INTO sysdba.OPPORTUNITY_CONTACT (OPPCONTACTID,CONTACTID,OPPORTUNITYID,CREATEDATE,CREATEUSER,MODIFYDATE,MODIFYUSER) VALUES ('#tmp#','#arguments.contactid#','#arguments.opportunityid#',#nowDate#,'#adminid#',#nowDate#,'#adminid#')";


#preserveSingleQuotes (SQL)#


SB
[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/26/2024 6:23:30 AM