- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2017 11:29 AM
I've seen this topic multiple times around the community but the solutions on do not seem to work for my code. It updates the field for a brief second then when it loads on the list, it reverts back to the original value.
Table: <Extended_task_table>
Order: 100
Action name: statusupdate
Active: Checked
Show update: Checked
Onclick: statusChange()
Condition: current.state == 10
function statusChange(){
g_form.setValue('state',20);
gsftSubmit(null, g_form.getFormElement(), 'statusupdate');
if (typeof window == 'undefined')
serverResolve();
function serverResolve(){
current.state = 20;
current.update();
action.setRedirectURL(current);
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2017 11:56 AM
Ah, it was a scoping issue. Had to move the if statement and the serverSide function outside the original function.
Correct:
function statusChange(){
g_form.setValue('state',20);
gsftSubmit(null, g_form.getFormElement(), 'statusupdate');
}
if (typeof window == 'undefined')
serverResolve();
function serverResolve(){
current.state = 20;
current.update();
action.setRedirectURL(current);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2017 11:32 AM
Hi John,
Try using below snippet.
function statusChange(){
//g_form.setValue('state',20);
gsftSubmit(gel('statusupdate'));
// if (typeof window == 'undefined')
serverResolve();
function serverResolve(){
current.state = 20;
current.update();
action.setRedirectURL(current);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2017 11:39 AM
It does change the field value, but does not automatically update the record.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2017 11:42 AM
It should ideally as it has current.update(). Could you check in activity once & try testing by commenting action.setRedirectURL(current); line from code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2017 11:48 AM
Still seems to stay on the page after switching the "State".