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: How To: Delete a row from a table in script
Brian Kempe
Posts: 53
 
How To: Delete a row from a table in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Aug 06 5:32 PM
fiogf49gjkf0d
I recently added my own popup menu and turned off the built in add edit delete features. My add and edit forms fire ok but my delete statements choke.
I've tried:
------------------------------------------------------------------
strSQL = "Delete From C_PROJECT_TASKS " _

& "Where C_PROJECT_TASKID"

Set objRS = RemoveSelectionFromGrid(DataGrid1, "C_PROJECT_TASKSID", True, strSQL)
------------------------------------------------------------------
where c_Project_TasksID is the keyfield in DataGrid1
I get: Error in include file SLX_Common ( Variable is undefined SLX_DB at line 271)
I do have SLX_Common included
I tried writing my own connection and delete statement based on "C_PROJECT_TASKSID=datagrid1.selection"
But, it failed also.
I've tried messing with the syntax and am ready for a hint ... OK what the heck I'll even take the solution if you have it handy



[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: How To: Delete a row from a table in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Aug 06 5:40 PM
fiogf49gjkf0d
Simple is best. Just delete the row from the database then refresh the grid:

sql = "delete from c_project_tasks where c_project_tasksid = '" & _
datagrid1.GetCurrentField("c_project_tasksid") & "'"

Application.GetNewConnection.Execute sql
datagrid1.Refresh


[Reply][Quote]
Brian Kempe
Posts: 53
 
Re: How To: Delete a row from a table in scriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Aug 06 5:55 PM
fiogf49gjkf0d
Perfect! I told you all I was Green. But hey, I'll help fill up your archive with some beginner Q and A's.
I was close. I tried some SQL stements very close to yours only I failed to get the "datagrid1.GetCurrentField("c_project_tasksid") " part right.
Thanks again.
Sage should sponsor this site!
RYAN for PRESIDENT
[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 10:51:01 AM