- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2023 05:01 PM
Hello All,
I want to create UI Macro Button next to Priority Field (like the below image) and display a text explaining the Priority values 1,2,3,4. Priority field is an OOB field from task and used on the story table. Request you to help on the UI Macro on how to build this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2023 06:01 PM
Hi @Hari7 ,
Follow along to get your requirement.
UI Page:
Create a UI Page as below,
name: priority_info_ui_page
Script:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_loc_name" jelly="true">
<div>
<b>P1:</b> <p>Your explaination</p>
<b>P2:</b> <p>Text for P2</p>
<b>P3:</b> <p>Text for P3</p>
<b>P4:</b> <p>Text for P4</p>
</div>
</j:jelly>
Create a UI Macro (System UI -> UI Macros -> New):
create an UI Macro as below.
Name: priority_info_button
Script:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<span id="u_priority_info_button" onclick="showPriorityInfo()" title="Priority info" alt="Priority Info" tabindex="0" class="btn btn-default icon-comment">
<span class="sr-only">Priority info</span>
</span>
<script type="text/javascript">
function showPriorityInfo(){
var gm = new GlideModal("priority_info_ui_page");
gm.setTitle("Priority information");
gm.setWidth(400);
gm.render();
}
</script>
</j:jelly>
Add it to the Priority Field:
Now we have to attach this UI Macro to the Priority field.
1. Right click on Priority field label and select "Configure Dictionary"
2. If you couldn't see Attributes field In the dictionary form opened, click on Advanced View related link at the page bottom.
3. If the field doesn't have any attributes adde just past this "ref_contributions=priority_info_button". If there are attributes already present just add a , at the end paste the above string.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2023 01:10 AM
@Kartik Gopal Thanks.
Actually that g: evaluate is not required, you can remove that line.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2023 07:53 AM
Actually the code worked only after closing the g: evaluate loop. Thanks for your help on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2023 10:51 AM
Hi @Hari7 ,
I meant to say the line <g:evaluate var="jvar_loc_name" jelly="true"> itself I forgot to remove after copying the code from my PDI. If you just remove this line no need to add closing the g:evaluate tag.
Anyway, it helped you, happy for that 🙂
Anvesh