- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2016 11:24 AM
I'm trying to get a UI Action to appear based on a function in a script include.
My script include contents:
function myCustomShowUIButton() {
return false;
}
The condition line of my UI action:
myCustomShowUIButton()
I would expect the UI action button to not appear because the function returns false. However this does not appear to work. Any ideas?
Jason
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2016 08:49 AM
You are correct about UI actions being executed on the client side, but incorrect regarding the condition and visibility. If the condition on a UI action is not met, the html and java-script is not even sent to the browser, so the button never appears at all (not even briefly). If using a client script to hide a button, the html and javascript must first be sent to the browser, and it is displayed. Once the client scripts then catch up, the button disappears, but this can take about 1 second so the button appears briefly.
Sadly I do not think a function from a Script Include (whether a simple function or using a class) can be used on the condition line of a UI Action.
Jason
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2016 12:05 PM
It will be the same because UI action has to be executed on client side and also server side. Same for script include which is server side and ui action with its client side script.
If I were you, i will go through the easiest way to achieve that.
What do you mean by 'if a record appears in a different unrelated table' ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2016 08:49 AM
You are correct about UI actions being executed on the client side, but incorrect regarding the condition and visibility. If the condition on a UI action is not met, the html and java-script is not even sent to the browser, so the button never appears at all (not even briefly). If using a client script to hide a button, the html and javascript must first be sent to the browser, and it is displayed. Once the client scripts then catch up, the button disappears, but this can take about 1 second so the button appears briefly.
Sadly I do not think a function from a Script Include (whether a simple function or using a class) can be used on the condition line of a UI Action.
Jason
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2016 12:07 PM
Make sure the function name is the exact name as the Script Include name. Hope that helps.