- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-25-2019 02:26 AM
Hi All,
Can anyone help me with the below requirement.
Create 'Reject' UI Action on demand & it should appear when demand is in deferred state.
Rejecting the demand should set the demand to inactive and state = reject. Also make a worknote required
- Thank you.
Solved! Go to Solution.
- Labels:
-
Demand Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-25-2019 03:20 AM
I just realized that client and server code is mixed up. Try this code.
Make sure you check the client checkbox, specify the Onclick function and add an action name for your UI action as reject_demand
Also use the actual state choice value for the Reject state and not its label.
function reject(){
if(g_form.getValue('work_notes') == ''){
g_form.setMandatory('work_notes', true);
g_form.addInfoMessage("Enter Work notes");
return;
}
//Call the UI Action and skip the 'onclick' function
gsftSubmit(null, g_form.getFormElement(), 'reject_demand'); //MUST call the 'Action name' set in this UI Action
}
if(typeof window == 'undefined')
rejectDemand();
//Server-side function
function rejectDemand(){
current.state = '2'; //Replace with your reject state choice value
current.active = false;
current.update();
action.setRedirectURL(current);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-25-2019 02:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-25-2019 02:41 AM
Hi Ak,
How do we make the ''worknotes'' mandatory?
- Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-25-2019 02:44 AM
Try this
if(current.work_notes == ''){
g_form.addInfoMessage("Enter Work notes");
g_form.setMandatory('work_notes', true);
}else{
current.state = 'reject'; //Replace with your reject state choice value
current.active = false;
current.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â04-25-2019 02:57 AM