UI Action to Check for Mandatory fields before Updating State
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2020 12:22 PM
Hi All,
I have requirement to update the state using the UI action and this UI action should update the state only when Mandatory fields are getting populated .
This is UI action is making state to 'Closed' and we have UI policy to make certain fields mandatory when state changes to Closed .
So this UI action should not be updating the state with out checking for Mandatory fields.
Below UI action created with client checkbox selected , this is not working .
function movearbitration() {
//Call the UI Action and skip the 'onclick' function
gsftSubmit(null, g_form.getFormElement(), 'hr_labor_arbitration'); //MUST call the 'Action name' set in this UI Action
}
//Code that runs without 'onclick'
//Ensure call to server-side function with no browser errors
if (typeof window == 'undefined')
if ((g_form.getValue('u_resolution_code') != '') && (g_form.getValue('u_resolution_description') != '') && (g_form.getValue('u_precedent') != '')){
runArbitrationcode();
function runArbitrationcode() {
current.state = 3;
current.update();
gs.addInfoMessage('Labor case has been moved to arbitration');
action.setRedirectURL(current);
}
}
else{
gs.addErrorMessage("Please fill in mandatory fields");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2020 02:08 PM
Could you please guide .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2020 02:18 PM
We cannot redirect to a particular field. Users have to manually navigate to those fields to fill in.
You can display an error message based on empty value that these fields are not filled in.
g_form.addErrorMessage("Please enter Resolution code..........."));
use the above line in the client-side of UI action before "return".
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2020 02:49 PM
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2020 02:53 PM
Sounds Good!
Muhammad