I am trying to update the data for the current node. I have no problem updating a text field, but when I try to update a integer field it refuses to update.
I tried looking with SQL Profiler and it seems to me that if I use SetIntegerValue the SQL gets written without that field being updated (it still has the old value). If I use SetValue the SQL doesn't get fired at all.
Here is some sample code:
var ui = UserInfoProvider.GetUserInfo(CMSContext.CurrentUser.UserName);
var tree = new CMS.TreeEngine.TreeProvider(ui);
var node = tree.SelectSingleNode(CMSContext.CurrentPageInfo.NodeId);
var approvals = node.GetIntegerValue("Approvals");
//node.SetIntegerValue("Approvals", approvals--, true);
node.SetValue("Approvals", Convert.ToString(approvals--));
node.SetValue("Title", approvals.ToString()); //For testing purposes - update the title
node.Update();