11/26/2024 4:25:41 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 building external web applications for SalesLogix. View the code of conduct for posting guidelines.
|
|
|
|
Adding Contacts in SalesLogix - Error with creating addresses
Posted: 08 Aug 07 2:47 PM
|
Hey all,
I'm having a problem...I'll give you the code first because the error i'm getting is pretty generic.
The following is a part of a web service that allows users to register over the internet, and get dumped into sales logix as a contact...Pretty simple stuff. I have 3 other blocks of code, that work great with this, but for some reason, it doesn't work with the address table. I checked the sql out that is generated against a query window, and it all checks out and works..only when i run it thru the oledb provider, does it not work.
Here's the code i'm using. It's currently set as stand alone, so i could debug it easier:
The database provider: assword=ersist=;Security=;Info=True;User ID=admin;Initial Catalog=SALESLOGIX_SERVER;Data Source=SVR-ITDEV01;Extended Properties='PORT=1706;LOG=ON;CASEINSENSITIVEFIND=ON;AUTOINCBATCHSIZE=1;'"/>
The Code: _ Public Function Function_AddNewAddress() As String
Function_AddNewAddress = "Account Address Created" Dim slxCnxn As New OleDbConnection(ConfigurationManager.ConnectionStrings("slxConnection").ConnectionString) Dim str As String = String.Empty Dim cmdAddNewAddress As New OleDbCommand Try
slxCnxn.Open() cmdAddNewAddress.CommandType = CommandType.Text str = "INSERT INTO [sysdba].[ADDRESS]" & _ "([ADDRESSID],[ENTITYID])" & _ "VALUES(" & _ "'QVJOMA00K3AK'," & _ "'QVJOMA00K3AJ')" System.Diagnostics.Debug.Write(str)
cmdAddNewAddress.CommandText = str cmdAddNewAddress.Connection = slxCnxn cmdAddNewAddress.ExecuteNonQuery() slxCnxn.Close() Catch ex As Exception Function_AddNewAddress = "New Address Failed: " & ex.Message Finally slxCnxn.Dispose() End Try Return Function_AddNewAddress End Function
The Error Message: "An unknown or internal error has occurred."
Are there any tricks I should know about before creating new addresses? I have a longer version of the code that actually has a value for each item in the Table, but i get the same results.
And of course, I'm using a new AddressID, that was generated with the NewID(tablename) command, and is not currently in use. And the EntityID is referencing an actual Record. The same code is working for adding info to other tables, so I'm not sure why this one alone is crapping out.
Any thoughts, ideas, suggestions would be great.
Thanks
~Dan
|
|
|
| |
|
Re: Adding Contacts in SalesLogix - Error with creating addresses
Posted: 09 Aug 07 7:23 PM
|
Have you stepped through the code and determine where it fails?
Most of the problems ocurr while openning the connection.
If the problem ocurrs while openning the connection, then the problem is going to be related to the Provider. Do you have SLX installed on the dev machine? If so, can you connect to the DB?
The way I typically troubleshoot connection issues is by creating a Text file, rename it to UDL and then doublecliking on it. Configure it with the SLX OLE Provider and test the connection. Once that is succesful, I open it on Notepad and extract the Connection string for use in my program.
If the UDL test also gives you a similar error, then I would make sure to have installed the correct version of the Provider (including Service Packs - Specially if you installed 7.0). |
|
|
|
Re: Adding Contacts in SalesLogix - Error with creating addresses
Posted: 10 Aug 07 9:03 AM
|
Hi Raul, Thanks for the Response.
I have no trouble with the actual connection. I have other code that executes fine, and posts to the table, it seems to only be a problem adding information into the address table. The Error occurs when it tries to execute the Insert Query.
And yes, I've stepped thru to find when the error occurs, thats where it occurs. Sorry, i didn't make that clear on the question.
~Dan |
|
|
|
Re: Adding Contacts in SalesLogix - Error with creating addresses
Posted: 10 Aug 07 9:21 AM
|
Hi Dan,
I've just had a quick test of this using the execute SQL option in SalesLogix Administrator and Ryan is correct. Attempting to run the same SQL you are using gives an error. However if you remove the square brackets it runs without an error.
HTH Darron |
|
|
|
Re: Adding Contacts in SalesLogix - Error with creating addresses
Posted: 16 Aug 07 9:30 AM
|
Dan if every other part of this code is working OK in some other part of your ws , then i have something for you.
Why are you writing an ID starting with Q into the EntityID column of address table? If your are going to insert an address for the contact , then entityid for that contact should have that contactid and not a generic saleslogix ID in it.Also when your wrting why dont you populate a valid address with the Primaryaddress field.Maybe the provider didnt like it this way.
|
|
|
|
Re: Adding Contacts in SalesLogix - Error with creating addresses
Posted: 05 Sep 07 9:08 AM
|
Originally posted by Nandu
Dan if every other part of this code is working OK in some other part of your ws , then i have something for you.
Why are you writing an ID starting with Q into the EntityID column of address table? If your are going to insert an address for the contact , then entityid for that contact should have that contactid and not a generic saleslogix ID in it.Also when your wrting why dont you populate a valid address with the Primaryaddress field.Maybe the provider didnt like it this way.
|
|
Hmm....I often use the ACCOUNTID for the AddressID and EntityId......likewise the ContactID for the AddressID and EntityID.....for the first and primary address record stored for a new Account, Contact..... makes for some fairly simple coding....
And you can put most any value into an ID field as long as it's non exotic characters, char12, unique, etc..... although some of us have written code that goes after EntityID where it begins with a C or A or U, etc.
Anyway, I don't think it's the Q's......
|
|
|
|
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!
|
|
|
|
|
|
|
|