11/26/2024 5:25:45 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 using the SalesLogix OLE DB Provider from external applications (including usage of built-in provider procedures). View the code of conduct for posting guidelines.
|
|
|
|
insert from web site
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 |
|
|
|
Re: insert from web site
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 |
|
|
|
Re: insert from web site
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 |
|
|
|
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!
|
|
|
|
|
|
|
|