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!
 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: Failed to parse SQL in managed Form when no SQL script was executed
Daniel Bechtel
Posts: 9
 
Failed to parse SQL in managed Form when no SQL script was executedYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Sep 06 12:01 PM
fiogf49gjkf0d
I'm building a new managed form for the AccountProduct view where I manage 2 additional tables based on the accountproduct table which contains additional fields for the accountproduct table and a history file as audit file.
I'm controlling when writing the records within the scripts I have.

If gStrMode = "Add" Then 'DNL
strSQLP = "Select * From AccountProduct Where 1=2" 'DNL
Else
strSQLP = "Select * From AccountProduct Where ACCOUNTPRODUCTID = '" & frmAdd_Edit_nu_AccountProduct.CurrentID & "'" 'DNL
End If

' Write / Update AccountProduct Table
Set objRSP = objSLXDB.GetNewRecordSet
objRSP.Locktype = adLockBatchOptimistic
objRSP.Open strSQLP, objSLXDB.Connection

If gStrMode = "Add" Then 'DNL
objRSP.AddNew
objRSP.Fields("ACCOUNTPRODUCTID").Value = frmAdd_Edit_nu_AccountProduct.CurrentID 'DNL
objRSP.Fields("PRODUCTID").Value = txtProductId.Text'DNL
objRSP.Fields("CREATEDATE").Value = Now 'DNL
objRSP.Fields("CREATEUSER").Value = Application.BasicFunctions.CurrentUserID 'DNL
objRsP.Fields("ACCOUNTID").Value = Application.BasicFunctions.CurrentAccountID
End If

if IsNumeric(txtQuantity.text) then
objRSP.Fields("QUANTITY").Value = txtQuantity.Text 'DNL
end if

objRSP.Fields("SERIALNUMBER").Value = txtSerialNumber.Text 'DNL
objRSP.Fields("USERFIELD2").Value = plStatus.Text 'DNL
objRSP.Fields("USERFIELD3").Value = txtQuantity.Text 'DNL
objRSP.Fields("USERFIELD4").Value = dtStartDate.Text 'DNL
objRSP.Fields("USERFIELD5").Value = dtEnddate.Text 'DNL
objRSP.Fields("USERFIELD8").Value = txtMaintenanceUSD.Text 'DNL

objRSP.Fields("MODIFYUSER").Value = Application.BasicFunctions.CurrentUserID 'DNL
objRSP.Fields("MODIFYDATE").Value = Now 'DNL

objRSP.UpdateBatch
Set objRSP = Nothing


Set objRS = objSLXDB.GetNewRecordSet
objRS.Locktype = adLockBatchOptimistic


If gStrMode = "Add" Then 'DNL
strSQL = "Select * From nu_Account_Product Where 1=2" 'DNL
Else
strSQL = "Select * From nu_Account_Product Where ACCOUNTPRODUCTID = '" & frmAdd_Edit_nu_AccountProduct.CurrentID & "'" 'DNL
End If
objRS.Open strSQL, objSLXDB.Connection

If gStrMode = "Add" Then 'DNL
objRS.AddNew
objRS.Fields("ACCOUNTPRODUCTID").Value = frmAdd_Edit_nu_AccountProduct.CurrentID 'DNL
objRS.Fields("CREATEDATE").Value = Now 'DNL
objRS.Fields("CREATEUSER").Value = Application.BasicFunctions.CurrentUserID 'DNL
End If
populateOBJRS objRS

objRS.UpdateBatch
Set objRS = Nothing

writeauditlog
frmAdd_Edit_nu_AccountProduct.ModalResult = mrOK

End Sub



Unfortunately I get when the Form ends (ModalResult = mrOK)
a failed to parse SQL
but I have no idea where this comes from.

Profiler also only shows this error message and nothing else.

Can someone point me in the right direction?

I tried this with a data from but got a duplicate key when the form tried to write the same record I wrote earlier.
I hoped to get arround that with the managed form.

Any help?
[Reply][Quote]
Daniel Bechtel
Posts: 9
 
Re: Failed to parse SQL in managed Form when no SQL script was executedYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Sep 06 12:19 PM
fiogf49gjkf0d
Ignore....
I found the issue.
DataMode was set to 1 instead of 0.
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: Failed to parse SQL in managed Form when no SQL script was executedYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Sep 06 5:55 PM
fiogf49gjkf0d
BTW.. not a good thing to do.. putting datetime in string fields..

objRSP.Fields("USERFIELD4").Value = dtStartDate.Text 'DNL
objRSP.Fields("USERFIELD5").Value = dtEnddate.Text 'DNL

--
rjl
[Reply][Quote]
Daniel Bechtel
Posts: 9
 
Re: Failed to parse SQL in managed Form when no SQL script was executedYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Sep 06 8:11 PM
fiogf49gjkf0d
Thanks for the note.
But that is what the second file is for.
Those fields are dates in that file.

I need to populate them for legacy reasons.
[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 1:41:26 PM