How to get GlideModal box to appear based on condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 05:53 AM
I've built a GlideModal box within a UI Action and I'm wanting it to only appear if certain conditions are met.
The code for my GlideModal box is:
I've tried to create the following code to only get the GlideModal box to appear in certain conditions:
var getAssessment = new GlideRecord('asmt_assessment_instance');
getAssessment.addEncodedQuery("metric_type=7e3e99001b6ffc9009dd5e26464bcb6a^stateINready,wip^trigger_id=" + current.getValue('sys_id'));
getAssessment.query();
if(!getAssessment)
generateConfirmation();
The above code looks for any entries in the asmt_assessment_instance table where the metric type is 7e3e99001b6ffc9009dd5e26464bcb6a and the State is either Ready or Work In Progress and the Trigger ID is the ID of the current Business Application. It then states if the conditions are not met then generate the GlideModal box.
I was just wondering if somebody could confirm what I'm doing wrong.