Hide button on service portal based on condition in server script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2020 05:00 AM
Hello,
I need to hide a button on the service portal if a condition in the server script is true. From what i can tell, the button should disappear, as the condition is returning the correct value. Do i need to pass something to the client script to make it disappear? Or is a condition in the server script enough to make this happen?
data.hideButton = true;
if (<condition>)
data.hideButton = false;
and the ng-if for the button in the HTML is using data.hideButton
Do i need anything else for this to work? in the client script possibly? Let me know if more info is needed.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2020 05:06 AM
Hi,
your steps seems correct:
Please check your condition first, if still doesn't work, please share code + printscreens with example.
Cheers
Alberto

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2020 05:07 AM
Hello,
Check this for help,
If answer is helpful please mark correct and helpful!
Thanks,
Pratiksha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2020 05:28 AM
Hi,
Yes, you are using correct logic, but I guess you are not checking correct condition.
if in your server script
data.hideButton = false;
then
<button type="button" ng-if="! data.hideButton">Submit</button>
will hide the button
Thanks,
Anil
Thanks
Anil Lande