I am working for a client who would like a button to set all of the records in a table to either "Valid" or "" (blank). This then allows them to build groups on what records needs to be updated. I started my adventure by reading Kris Halsrud's post Retrieving the Manager in SalesLogix 7.5 Web . The solution Kris outlines provided most of what I needed and direct conversation with Kris himself provided the rest. I wanted to document it here so I do not have to bug him the next time I need to do this.
This is what our C# Snippet Action item looks like launched from the button.
Sage.Platform.Data.IDataService datasvc = Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Data.IDataService>();using (System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(datasvc.GetConnectionString()))
conn.Open(); System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand("update sysdba.TABLE set FIELD = 'Value'",conn);
The green text is the slq statement, the rest should be able to be used as is. I hope this little post helps someone else down the line.