Please help with UI Action script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 11:09 PM
Hello,
I am using UI action function to call server side code to update records (Only for test purposes).
Is it possible to use the "else" statement to call different server side code. If not, please provide suggestions.
Thank you
Here is the example code:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 11:15 PM - edited 03-20-2024 11:24 PM
Hi @Jessica28
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 11:20 PM - edited 03-20-2024 11:23 PM
@Jessica28 , You need to Call Another Function to Initiate Server Code , Below is the Corrected Code
function confirmUpdate() {
var answer = confirm('This will update all records! Are you sure?');
if (answer) {
gsftSumit(null, g_from.getFormElement(), 'updateConfirm');
}
return false;
}
//server side script
if (typeof window == 'undefined')
updatedetails();
function updatedetails(){
current.work_notes = "All records updated";
current.update();
action.setRediirectURL(current);
}
Regards,
Shyamkumar
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 11:36 PM
@Jessica28 , If this Helped can you Accept the Solution , So this Moves to Answered Queue
Regards,
Shyamkumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 11:39 PM
Thank you for help. Could you please let me know how to call a business rule from an UI Action.
For example in the else statement. This is for my learning purposes.