public bool deleteRecords(string db, string query) { try { PurgeRecords.Builder builder = new PurgeRecords.Builder(__ticket, __token, __domain, db); if (query != "") { builder.SetQuery(query); } var response = builder.Build().Post().CreateNavigator(); var errcode = response.SelectSingleNode("/qdbapi/errcode").ToString(); if (errcode == "0") { return(true); } else { message = "Error " + response.SelectSingleNode("/qdbapi/errcode").ToString() + ": " + response.SelectSingleNode("/qdbapi/errtext").ToString(); } } catch (Intuit.QuickBase.Core.Exceptions.CannotChangeValueOfFieldException ex) { message = ex.Message; } return(false); }
private void SendDelete(string qry) { var prBuild = new PurgeRecords.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, Table.TableId); prBuild.SetQuery(qry.ToString()); var xml = prBuild.Build().Post(); int result = int.Parse(xml.Element("errcode").Value); if (result != 0) { string errmsg = xml.Element("errtxt").Value; throw new ApplicationException("Error in RemoveRecords: '" + errmsg + "'"); } }
public bool CleanTable(string db) { try { PurgeRecords.Builder purge = new PurgeRecords.Builder(__ticket, __token, __domain, db); purge.SetQid(1); var response = purge.Build().Post().CreateNavigator(); var errcode = response.SelectSingleNode("/qdbapi/errcode").ToString(); if (errcode == "0") { return(true); } else { message = "Error " + response.SelectSingleNode("/qdbapi/errcode").ToString() + ": " + response.SelectSingleNode("/qdbapi/errtext").ToString(); } } catch (Exception e) { message = e.Message; } return(false); }