Display an Error message on clicking the button.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 11:37 AM
Hi,
I have a requirement, in APM record there is section called relations and there is button named edit relationships...if I click the button it redirects to different page to edit relations...now for records which are in retired or transferred status then on clicking the button it should not redirect to next page instead it should throw an error like "you can't edit it".
The idea here is if the records are in transferred or retired status then the button should not perform instead throw an error.
How to achieve this please explain in detail.
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 11:59 AM
Hi @suuriya ,
U need to add some code in the existing UI action Edit Relationships,
Please follow below steps:
- Navigate to System UI -->UI Action
- Search Name is Edit Relationships
- If there is only one record found open that record.
- If the UI action is created on business app table then u can write the below code
if(current.status == "retired" || current.status == "transferred"){
g_addInfoMessage('you can't edit it');
}
If the UI action is client checked then replace the if condition with
if(g_form.getValue('status') == 'retired' || g_for.getValue('status') == 'transferred'){
alert(' you can not edit this');
}
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 04:29 AM
HI @Danish Bhairag2 ,
Thanks for your reply...I checked it(edit relationship) is not ui action it is UI Page.....For Ui Page how we can write the script....how we can achieve this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 04:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2023 04:50 AM