Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 18, 2025 
 
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 - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Help in Insert
Anjo Tanada
Posts: 24
 
Help in Insert Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Dec 07 12:56 AM
The string objSLXDB.execute strsql does not work

Dim strSQL
Dim objSLXDB
Set objSLXDB = Application.GetNewConnection

strSQL = "INSERT INTO C_FAMILY " &_
" (C_FAMILYID " &_
" ,ACCOUNTID " & _
" ,FIRSTNAME " & _
" ,LASTNAME" & _
" ,MIDDLENAME " & _
" ,BIRTHDATE " & _
" ,RELATIONSHIP " & _
" VALUES " & _
" ('"&Application.BasicFunctions.GetIDFor("C_FamilyID") &"','" & txtAccountID.Text & "','"& txtFirstName.Text & "','" & txtLastName.Text & "','" & txtMiddleName.Text & "','" & DateTimePicker1.Date & "','" & PickList1.Text &"') "

objSLXDB.execute strSQL

strSQL = "INSERT INTO ADDRESS " & _
" (ADDRESSID " & _
" ,DESCRIPTION " & _
" ,ADDRESS1 " & _
" ,ADDRESS2 " & _
" ,ADDRESS3 " & _
" ,CITY " & _
" ,STATE " & _
" ,POSTALCODE " & _
" VALUES " & _
" ('" &Application.BasicFunctions.GetIDFor("ADDRESSID") & "','" & pkldescription.Text & "','" & txtadd.Text & "','" & txtadd2.Text & "','" & txtadd3.Text & "','" & pklCity.Text & "','" & pklstate.Text & "','" & txtzip.Text & "','" & pklCountry.Text &"') "


objSLXDB.execute strSQL
[Reply][Quote]
Anjo Tanada
Posts: 24
 
Re: Help in Insert Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Dec 07 1:48 AM
don't bother to answer already found the problem.
[Reply][Quote]
muni1900
Posts: 21
 
Re: Help in Insert Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Dec 07 9:24 AM
Hi Anjo,

Would you mind posting the solution you find? - as it will help others who face the same problem. Thanks in advance.

Muni
[Reply][Quote]
Lloy Sanders
Posts: 69
 
Re: Help in Insert Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Dec 07 7:48 AM
Both SQL statements are missing the ) after the field names, and before the "Values" section. Also, I believe you will need to add the EntityId to the Address table.
[Reply][Quote]
Anjo Tanada
Posts: 24
 
Re: Help in Insert Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Dec 07 2:53 AM
here is the answer

strSQL = "INSERT INTO C_FAMILY " &_
" (C_FAMILYID " &_
" ,ACCOUNTID " & _
" ,FIRSTNAME " & _
" ,LASTNAME" & _
" ,MIDDLENAME " & _
" ,BIRTHDATE " & _
" ,RELATIONSHIP ) " & _
" VALUES " & _
" ('"&Application.BasicFunctions.GetIDFor("C_FamilyID") &"','" & txtAccountID.Text & "','"& txtFirstName.Text & "','" & txtLastName.Text & "','" & txtMiddleName.Text & "','" & DateTimePicker1.Date & "','" & PickList1.Text &"') "
'msgbox strsql
objSLXDB.execute strSQL

strSQL = "INSERT INTO ADDRESS " & _
" (ADDRESSID " & _
" ,DESCRIPTION " & _
" ,ADDRESS1 " & _
" ,ADDRESS2 " & _
" ,ADDRESS3 " & _
" ,CITY " & _
" ,STATE " & _
" ,POSTALCODE " & _
" ,COUNTRY " & _
" ,ENTITYID )" & _
" VALUES " & _
" ('" & Application.BasicFunctions.GetIDFor("ADDRESSID") & "','" & pkldescription.Text & "','" & txtadd.Text & "','" & txtadd2.Text & "','" & txtadd3.Text & "','" & pklCity.Text & "','" & pklstate.Text & "','" & txtzip.Text & "','" & pklCountry.Text &"', 0 ) "

' msgbox strsql
objSLXDB.execute strSQL
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Help in Insert Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Dec 07 5:22 AM
Should the Address.Entityid value be set to the Account.AccountID?
[Reply][Quote]
Jeff Weight
Posts: 219
 
Re: Help in Insert Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Dec 07 9:39 AM
No, as it won't be tying back to the account - but I guess it would work if it had the C_FamilyID in it.
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Help in Insert Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Dec 07 9:46 AM
In order to utilize the address information it would see that either the c_family record needs to have an addressid reference, the entityid needs to be set, or both.
[Reply][Quote]
Jeff Weight
Posts: 219
 
Re: Help in Insert Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Dec 07 9:59 AM
Very true - it wouldn't be necessary, but as with accounts and contacts, Monkey See Monkey Do, right?

I just figured it would be best to follow the example.
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Help in Insert Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Dec 07 10:41 AM
The 2nd sample SQL set the entiryid to 0. Which may not make much sense.
[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 © 2025 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): 8/18/2025 9:16:00 AM